Run this model with HF Jobs
Run 01-ai/Yi-9B on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/01-ai/Yi-9B. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/01-ai/Yi-9B on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/01-ai/Yi-9B. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/01-ai/Yi-9B. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use 01-ai/Yi-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use 01-ai/Yi-9B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="01-ai/Yi-9B")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("01-ai/Yi-9B") model = AutoModelForCausalLM.from_pretrained("01-ai/Yi-9B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use 01-ai/Yi-9B 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" # 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", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/01-ai/Yi-9B
- SGLang
How to use 01-ai/Yi-9B 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" \ --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", "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" \ --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", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use 01-ai/Yi-9B with Docker Model Runner:
docker model run hf.co/01-ai/Yi-9B
|
Download Yi.svg from 01-ai/Yi-9B: direct link, hf CLI and curl.
- Browser
- Download file 980 Bytes
-
https://huggingface.co/01-ai/Yi-9B/resolve/main/Yi.svg
- Command line
-
hf download hf://01-ai/Yi-9B/Yi.svg
-
curl -L -o Yi.svg https://huggingface.co/01-ai/Yi-9B/resolve/main/Yi.svg
980 Bytes
| <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -2600 2500 2500"> | |
| <circle xmlns="http://www.w3.org/2000/svg" cx="1250" cy="-1350" r="1250" fill="#003426"/> | |
| <path xmlns="http://www.w3.org/2000/svg" d="M -50 -1285 m 670 -889 c 54 55 400 489 414 519 c 30 64 -12 145 -87 167 c -67 20 -107 -14 -297 -257 c -30 -39 -84 -106 -121 -150 c -123 -148 -135 -174 -104 -238 c 38 -80 137 -100 195 -41 z m 1196 43 c 30 18 64 74 64 105 c 0 8 -6 28 -12 43 c -12 27 -19 36 -68 93 c -12 14 -52 60 -88 104 c -174 205 -278 326 -325 380 l -52 59 l -5 419 l -5 418 l -36 36 c -61 61 -148 51 -196 -23 c -17 -25 -18 -60 -18 -468 c 0 -511 -18 -433 144 -625 c 314 -372 447 -524 475 -541 c 39 -24 83 -24 122 0 z m 235 0 m -158 965 c 18 7 43 26 57 41 l 25 27 l 3 286 c 2 271 1 289 -17 319 c -54 87 -164 86 -217 -1 c -17 -28 -19 -54 -19 -306 c 0 -305 2 -315 64 -357 c 39 -27 59 -28 104 -9 z" fill="#ffffff"/> | |
| <circle xmlns="http://www.w3.org/2000/svg" cx="2000" cy="-1500" r="125" fill="#00FF25"/> | |
| </svg> |