Instructions to use 01-ai/Yi-9B-200K with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use 01-ai/Yi-9B-200K with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="01-ai/Yi-9B-200K")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("01-ai/Yi-9B-200K") model = AutoModelForMultimodalLM.from_pretrained("01-ai/Yi-9B-200K") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use 01-ai/Yi-9B-200K with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "01-ai/Yi-9B-200K" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "01-ai/Yi-9B-200K", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/01-ai/Yi-9B-200K
- SGLang
How to use 01-ai/Yi-9B-200K with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "01-ai/Yi-9B-200K" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "01-ai/Yi-9B-200K", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "01-ai/Yi-9B-200K" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "01-ai/Yi-9B-200K", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use 01-ai/Yi-9B-200K with Docker Model Runner:
docker model run hf.co/01-ai/Yi-9B-200K
Commit ·
d6d03ad
1
Parent(s): ea0eede
updata weight v20240321
Browse files- CHANGELOG.md +4 -0
- images/v20240321.png +0 -0
- md5 +4 -4
- model-00001-of-00004.safetensors +1 -1
- model-00002-of-00004.safetensors +1 -1
- model-00003-of-00004.safetensors +1 -1
- model-00004-of-00004.safetensors +1 -1
CHANGELOG.md
CHANGED
|
@@ -1,4 +1,8 @@
|
|
| 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
## version: v20240318
|
| 3 |
- train 12B tokens with 256k context window
|
| 4 |
- recall of "Needle in A HayStack": 97.5% [](./images/v20240318.png)
|
|
|
|
| 1 |
|
| 2 |
+
## version: v20240321
|
| 3 |
+
- train 17B tokens with 256k context window
|
| 4 |
+
- recall of "Needle in A HayStack": 99.0% [](./images/v20240321.png)
|
| 5 |
+
|
| 6 |
## version: v20240318
|
| 7 |
- train 12B tokens with 256k context window
|
| 8 |
- recall of "Needle in A HayStack": 97.5% [](./images/v20240318.png)
|
images/v20240321.png
ADDED
|
md5
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
291724ef50f729e45d68f474a7755bbc tokenizer.model
|
|
|
|
| 1 |
+
ea4c0821c336830245134cd7d0e434c1 model-00001-of-00004.safetensors
|
| 2 |
+
54cc12ebbc4588f73938a335b4d209e5 model-00002-of-00004.safetensors
|
| 3 |
+
b3e58b8607b977476ee0ad7d1817eee5 model-00003-of-00004.safetensors
|
| 4 |
+
f4162fd64b5f47758ffdd652d2eea742 model-00004-of-00004.safetensors
|
| 5 |
291724ef50f729e45d68f474a7755bbc tokenizer.model
|
model-00001-of-00004.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4932711424
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a8e111c2abf7439e96a405abc7d5d16cd810ac0c2ab6e753e3ac4c347594e6bb
|
| 3 |
size 4932711424
|
model-00002-of-00004.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4976802816
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e404ae15a3f6c0fb0f23fe096aa3b839c836b8ea7cf1bc71ab62e82918165c6c
|
| 3 |
size 4976802816
|
model-00003-of-00004.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4968397360
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c735370383b7fd936e15cbcfc05ea58327c306bcafed4794de8a78219e80322e
|
| 3 |
size 4968397360
|
model-00004-of-00004.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 2780953384
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:273253da7c24a105ec95c53ab4acebde6fc1c287e8782904a58fef766594e4bd
|
| 3 |
size 2780953384
|