Instructions to use NousResearch/Yarn-Llama-2-70b-32k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NousResearch/Yarn-Llama-2-70b-32k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NousResearch/Yarn-Llama-2-70b-32k", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("NousResearch/Yarn-Llama-2-70b-32k", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("NousResearch/Yarn-Llama-2-70b-32k", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use NousResearch/Yarn-Llama-2-70b-32k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NousResearch/Yarn-Llama-2-70b-32k" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NousResearch/Yarn-Llama-2-70b-32k", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/NousResearch/Yarn-Llama-2-70b-32k
- SGLang
How to use NousResearch/Yarn-Llama-2-70b-32k 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 "NousResearch/Yarn-Llama-2-70b-32k" \ --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": "NousResearch/Yarn-Llama-2-70b-32k", "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 "NousResearch/Yarn-Llama-2-70b-32k" \ --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": "NousResearch/Yarn-Llama-2-70b-32k", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use NousResearch/Yarn-Llama-2-70b-32k with Docker Model Runner:
docker model run hf.co/NousResearch/Yarn-Llama-2-70b-32k
Update README.md
Browse files
README.md
CHANGED
|
@@ -47,10 +47,10 @@ Long context benchmarks:
|
|
| 47 |
| [Yarn-Llama-2-70b-32k](https://huggingface.co/NousResearch/Yarn-Llama-2-70b-32k) | 32k | 3.61 | 3.22 | 2.91 | 2.82 | 2.45 | 2.23 |
|
| 48 |
|
| 49 |
Short context benchmarks showing that quality degradation is minimal:
|
| 50 |
-
| Model | Context Window | ARC-c |
|
| 51 |
-
|-------|---------------:|------:|-----
|
| 52 |
-
| [Llama-2-70b-hf](meta-llama/Llama-2-70b-hf) | 4k | 67.32 |
|
| 53 |
-
| [Yarn-Llama-2-70b-32k](https://huggingface.co/NousResearch/Yarn-Llama-2-70b-32k) | 32k | 67.41 |
|
| 54 |
|
| 55 |
## Collaborators
|
| 56 |
|
|
|
|
| 47 |
| [Yarn-Llama-2-70b-32k](https://huggingface.co/NousResearch/Yarn-Llama-2-70b-32k) | 32k | 3.61 | 3.22 | 2.91 | 2.82 | 2.45 | 2.23 |
|
| 48 |
|
| 49 |
Short context benchmarks showing that quality degradation is minimal:
|
| 50 |
+
| Model | Context Window | ARC-c | MMLU | Truthful QA |
|
| 51 |
+
|-------|---------------:|------:|-----:|------------:|
|
| 52 |
+
| [Llama-2-70b-hf](meta-llama/Llama-2-70b-hf) | 4k | 67.32 | 69.83 | 44.92 |
|
| 53 |
+
| [Yarn-Llama-2-70b-32k](https://huggingface.co/NousResearch/Yarn-Llama-2-70b-32k) | 32k | 67.41 | 68.84 | 46.14 |
|
| 54 |
|
| 55 |
## Collaborators
|
| 56 |
|