Instructions to use allenai/tulu-2-13b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use allenai/tulu-2-13b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="allenai/tulu-2-13b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("allenai/tulu-2-13b") model = AutoModelForCausalLM.from_pretrained("allenai/tulu-2-13b") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use allenai/tulu-2-13b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "allenai/tulu-2-13b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "allenai/tulu-2-13b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/allenai/tulu-2-13b
- SGLang
How to use allenai/tulu-2-13b 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 "allenai/tulu-2-13b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "allenai/tulu-2-13b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "allenai/tulu-2-13b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "allenai/tulu-2-13b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use allenai/tulu-2-13b with Docker Model Runner:
docker model run hf.co/allenai/tulu-2-13b
Update README.md
Browse files
README.md
CHANGED
|
@@ -37,27 +37,12 @@ For more details, read the paper: [Camels in a Changing Climate: Enhancing LM Ad
|
|
| 37 |
|
| 38 |
| Model | Size | Alignment | MT-Bench (score) | AlpacaEval (win rate %) |
|
| 39 |
|-------------|-----|----|---------------|--------------|
|
| 40 |
-
| **Tulu-v2-7b** πͺ | **7B** | **
|
| 41 |
-
| **Tulu-v2-dpo-7b** πͺ | **7B** | **
|
| 42 |
-
|
|
| 43 |
-
|
|
| 44 |
-
|
|
| 45 |
-
|
|
| 46 |
-
| Zephyr-7b-Ξ± |7B| dDPO| 6.88| -|
|
| 47 |
-
| Zephyr-7b-Ξ² πͺ | 7B | dDPO | 7.34 | 90.60 |
|
| 48 |
-
| **Tulu-v2-13b** πͺ | **13B** | **dDPO** | **6.70** | **78.9** |
|
| 49 |
-
| **Tulu-v2-dpo-13b** πͺ | **13B** | **dDPO** | **7.00** | **89.5** |
|
| 50 |
-
| Falcon-Instruct | 40B |dSFT |5.17 |45.71|
|
| 51 |
-
| Guanaco | 65B | SFT |6.41| 71.80|
|
| 52 |
-
| Llama2-Chat | 70B |RLHF |6.86| 92.66|
|
| 53 |
-
| Vicuna v1.3 | 33B |dSFT |7.12 |88.99|
|
| 54 |
-
| WizardLM v1.0 | 70B |dSFT |7.71 |-|
|
| 55 |
-
| Xwin-LM v0.1 | 70B |dPPO |- |95.57|
|
| 56 |
-
| **Tulu-v2-70b** πͺ | **70B** | **dDPO** | **7.49** | **86.6** |
|
| 57 |
-
| **Tulu-v2-dpo-70b** πͺ | **70B** | **dDPO** | **7.89** | **95.1** |
|
| 58 |
-
| GPT-3.5-turbo | - |RLHF |7.94 |89.37|
|
| 59 |
-
| Claude 2 | - |RLHF |8.06| 91.36|
|
| 60 |
-
| GPT-4 | -| RLHF |8.99| 95.28|
|
| 61 |
|
| 62 |
## Input Format
|
| 63 |
|
|
|
|
| 37 |
|
| 38 |
| Model | Size | Alignment | MT-Bench (score) | AlpacaEval (win rate %) |
|
| 39 |
|-------------|-----|----|---------------|--------------|
|
| 40 |
+
| **Tulu-v2-7b** πͺ | **7B** | **SFT** | **6.30** | **73.9** |
|
| 41 |
+
| **Tulu-v2-dpo-7b** πͺ | **7B** | **DPO** | **6.29** | **85.1** |
|
| 42 |
+
| **Tulu-v2-13b** πͺ | **13B** | **SFT** | **6.70** | **78.9** |
|
| 43 |
+
| **Tulu-v2-dpo-13b** πͺ | **13B** | **DPO** | **7.00** | **89.5** |
|
| 44 |
+
| **Tulu-v2-70b** πͺ | **70B** | **SFT** | **7.49** | **86.6** |
|
| 45 |
+
| **Tulu-v2-dpo-70b** πͺ | **70B** | **DPO** | **7.89** | **95.1** |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
## Input Format
|
| 48 |
|