Text Generation
Transformers
Safetensors
PyTorch
English
phi3
axolotl
finetune
dpo
microsoft
phi
phi-3
nlp
code
chatml
conversational
custom_code
Eval Results (legacy)
text-generation-inference
Instructions to use MaziyarPanahi/calme-2.2-phi3-4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MaziyarPanahi/calme-2.2-phi3-4b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MaziyarPanahi/calme-2.2-phi3-4b", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MaziyarPanahi/calme-2.2-phi3-4b", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("MaziyarPanahi/calme-2.2-phi3-4b", trust_remote_code=True, device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MaziyarPanahi/calme-2.2-phi3-4b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MaziyarPanahi/calme-2.2-phi3-4b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MaziyarPanahi/calme-2.2-phi3-4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MaziyarPanahi/calme-2.2-phi3-4b
- SGLang
How to use MaziyarPanahi/calme-2.2-phi3-4b 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 "MaziyarPanahi/calme-2.2-phi3-4b" \ --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": "MaziyarPanahi/calme-2.2-phi3-4b", "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 "MaziyarPanahi/calme-2.2-phi3-4b" \ --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": "MaziyarPanahi/calme-2.2-phi3-4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MaziyarPanahi/calme-2.2-phi3-4b with Docker Model Runner:
docker model run hf.co/MaziyarPanahi/calme-2.2-phi3-4b
Update README.md (#9)
Browse files- Update README.md (ed3146df3261c0ce1f882140c9e19eea72778c29)
README.md
CHANGED
|
@@ -20,7 +20,7 @@ inference: false
|
|
| 20 |
model_creator: MaziyarPanahi
|
| 21 |
quantized_by: MaziyarPanahi
|
| 22 |
model-index:
|
| 23 |
-
- name:
|
| 24 |
results:
|
| 25 |
- task:
|
| 26 |
type: text-generation
|
|
@@ -37,7 +37,7 @@ model-index:
|
|
| 37 |
value: 62.8
|
| 38 |
name: normalized accuracy
|
| 39 |
source:
|
| 40 |
-
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=MaziyarPanahi/
|
| 41 |
name: Open LLM Leaderboard
|
| 42 |
- task:
|
| 43 |
type: text-generation
|
|
@@ -53,7 +53,7 @@ model-index:
|
|
| 53 |
value: 80.76
|
| 54 |
name: normalized accuracy
|
| 55 |
source:
|
| 56 |
-
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=MaziyarPanahi/
|
| 57 |
name: Open LLM Leaderboard
|
| 58 |
- task:
|
| 59 |
type: text-generation
|
|
@@ -70,7 +70,7 @@ model-index:
|
|
| 70 |
value: 69.1
|
| 71 |
name: accuracy
|
| 72 |
source:
|
| 73 |
-
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=MaziyarPanahi/
|
| 74 |
name: Open LLM Leaderboard
|
| 75 |
- task:
|
| 76 |
type: text-generation
|
|
@@ -86,7 +86,7 @@ model-index:
|
|
| 86 |
- type: mc2
|
| 87 |
value: 59.97
|
| 88 |
source:
|
| 89 |
-
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=MaziyarPanahi/
|
| 90 |
name: Open LLM Leaderboard
|
| 91 |
- task:
|
| 92 |
type: text-generation
|
|
@@ -103,7 +103,7 @@ model-index:
|
|
| 103 |
value: 72.45
|
| 104 |
name: accuracy
|
| 105 |
source:
|
| 106 |
-
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=MaziyarPanahi/
|
| 107 |
name: Open LLM Leaderboard
|
| 108 |
- task:
|
| 109 |
type: text-generation
|
|
@@ -120,7 +120,7 @@ model-index:
|
|
| 120 |
value: 73.62
|
| 121 |
name: accuracy
|
| 122 |
source:
|
| 123 |
-
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=MaziyarPanahi/
|
| 124 |
name: Open LLM Leaderboard
|
| 125 |
- task:
|
| 126 |
type: text-generation
|
|
@@ -135,7 +135,7 @@ model-index:
|
|
| 135 |
value: 50.69
|
| 136 |
name: strict accuracy
|
| 137 |
source:
|
| 138 |
-
url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=MaziyarPanahi/
|
| 139 |
name: Open LLM Leaderboard
|
| 140 |
- task:
|
| 141 |
type: text-generation
|
|
@@ -150,7 +150,7 @@ model-index:
|
|
| 150 |
value: 37.73
|
| 151 |
name: normalized accuracy
|
| 152 |
source:
|
| 153 |
-
url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=MaziyarPanahi/
|
| 154 |
name: Open LLM Leaderboard
|
| 155 |
- task:
|
| 156 |
type: text-generation
|
|
@@ -165,7 +165,7 @@ model-index:
|
|
| 165 |
value: 2.34
|
| 166 |
name: exact match
|
| 167 |
source:
|
| 168 |
-
url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=MaziyarPanahi/
|
| 169 |
name: Open LLM Leaderboard
|
| 170 |
- task:
|
| 171 |
type: text-generation
|
|
@@ -180,7 +180,7 @@ model-index:
|
|
| 180 |
value: 9.51
|
| 181 |
name: acc_norm
|
| 182 |
source:
|
| 183 |
-
url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=MaziyarPanahi/
|
| 184 |
name: Open LLM Leaderboard
|
| 185 |
- task:
|
| 186 |
type: text-generation
|
|
@@ -195,7 +195,7 @@ model-index:
|
|
| 195 |
value: 7.7
|
| 196 |
name: acc_norm
|
| 197 |
source:
|
| 198 |
-
url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=MaziyarPanahi/
|
| 199 |
name: Open LLM Leaderboard
|
| 200 |
- task:
|
| 201 |
type: text-generation
|
|
@@ -212,23 +212,23 @@ model-index:
|
|
| 212 |
value: 31.27
|
| 213 |
name: accuracy
|
| 214 |
source:
|
| 215 |
-
url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=MaziyarPanahi/
|
| 216 |
name: Open LLM Leaderboard
|
| 217 |
---
|
| 218 |
|
| 219 |
<img src="./phi-3-instruct.webp" alt="Phi-3 Logo" width="500" style="margin-left:'auto' margin-right:'auto' display:'block'"/>
|
| 220 |
|
| 221 |
|
| 222 |
-
# MaziyarPanahi/
|
| 223 |
|
| 224 |
This model is a fine-tune (DPO) of `microsoft/Phi-3-mini-4k-instruct` model.
|
| 225 |
|
| 226 |
# ⚡ Quantized GGUF
|
| 227 |
|
| 228 |
-
All GGUF models are available here: [MaziyarPanahi/
|
| 229 |
|
| 230 |
# 🏆 [Open LLM Leaderboard Evaluation Results](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
|
| 231 |
-
Detailed results can be found [here](https://huggingface.co/datasets/open-llm-leaderboard/
|
| 232 |
|
| 233 |
| Metric |Value|
|
| 234 |
|-------------------|----:|
|
|
@@ -271,7 +271,7 @@ This model uses `ChatML` prompt template:
|
|
| 271 |
|
| 272 |
# How to use
|
| 273 |
|
| 274 |
-
You can use this model by using `MaziyarPanahi/
|
| 275 |
transformers library.
|
| 276 |
|
| 277 |
```python
|
|
@@ -279,7 +279,7 @@ from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
|
|
| 279 |
from transformers import pipeline
|
| 280 |
import torch
|
| 281 |
|
| 282 |
-
model_id = "MaziyarPanahi/
|
| 283 |
|
| 284 |
model = AutoModelForCausalLM.from_pretrained(
|
| 285 |
model_id,
|
|
|
|
| 20 |
model_creator: MaziyarPanahi
|
| 21 |
quantized_by: MaziyarPanahi
|
| 22 |
model-index:
|
| 23 |
+
- name: calme-2.2-phi3-4b
|
| 24 |
results:
|
| 25 |
- task:
|
| 26 |
type: text-generation
|
|
|
|
| 37 |
value: 62.8
|
| 38 |
name: normalized accuracy
|
| 39 |
source:
|
| 40 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=MaziyarPanahi/calme-2.2-phi3-4b
|
| 41 |
name: Open LLM Leaderboard
|
| 42 |
- task:
|
| 43 |
type: text-generation
|
|
|
|
| 53 |
value: 80.76
|
| 54 |
name: normalized accuracy
|
| 55 |
source:
|
| 56 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=MaziyarPanahi/calme-2.2-phi3-4b
|
| 57 |
name: Open LLM Leaderboard
|
| 58 |
- task:
|
| 59 |
type: text-generation
|
|
|
|
| 70 |
value: 69.1
|
| 71 |
name: accuracy
|
| 72 |
source:
|
| 73 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=MaziyarPanahi/calme-2.2-phi3-4b
|
| 74 |
name: Open LLM Leaderboard
|
| 75 |
- task:
|
| 76 |
type: text-generation
|
|
|
|
| 86 |
- type: mc2
|
| 87 |
value: 59.97
|
| 88 |
source:
|
| 89 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=MaziyarPanahi/calme-2.2-phi3-4b
|
| 90 |
name: Open LLM Leaderboard
|
| 91 |
- task:
|
| 92 |
type: text-generation
|
|
|
|
| 103 |
value: 72.45
|
| 104 |
name: accuracy
|
| 105 |
source:
|
| 106 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=MaziyarPanahi/calme-2.2-phi3-4b
|
| 107 |
name: Open LLM Leaderboard
|
| 108 |
- task:
|
| 109 |
type: text-generation
|
|
|
|
| 120 |
value: 73.62
|
| 121 |
name: accuracy
|
| 122 |
source:
|
| 123 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=MaziyarPanahi/calme-2.2-phi3-4b
|
| 124 |
name: Open LLM Leaderboard
|
| 125 |
- task:
|
| 126 |
type: text-generation
|
|
|
|
| 135 |
value: 50.69
|
| 136 |
name: strict accuracy
|
| 137 |
source:
|
| 138 |
+
url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=MaziyarPanahi/calme-2.2-phi3-4b
|
| 139 |
name: Open LLM Leaderboard
|
| 140 |
- task:
|
| 141 |
type: text-generation
|
|
|
|
| 150 |
value: 37.73
|
| 151 |
name: normalized accuracy
|
| 152 |
source:
|
| 153 |
+
url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=MaziyarPanahi/calme-2.2-phi3-4b
|
| 154 |
name: Open LLM Leaderboard
|
| 155 |
- task:
|
| 156 |
type: text-generation
|
|
|
|
| 165 |
value: 2.34
|
| 166 |
name: exact match
|
| 167 |
source:
|
| 168 |
+
url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=MaziyarPanahi/calme-2.2-phi3-4b
|
| 169 |
name: Open LLM Leaderboard
|
| 170 |
- task:
|
| 171 |
type: text-generation
|
|
|
|
| 180 |
value: 9.51
|
| 181 |
name: acc_norm
|
| 182 |
source:
|
| 183 |
+
url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=MaziyarPanahi/calme-2.2-phi3-4b
|
| 184 |
name: Open LLM Leaderboard
|
| 185 |
- task:
|
| 186 |
type: text-generation
|
|
|
|
| 195 |
value: 7.7
|
| 196 |
name: acc_norm
|
| 197 |
source:
|
| 198 |
+
url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=MaziyarPanahi/calme-2.2-phi3-4b
|
| 199 |
name: Open LLM Leaderboard
|
| 200 |
- task:
|
| 201 |
type: text-generation
|
|
|
|
| 212 |
value: 31.27
|
| 213 |
name: accuracy
|
| 214 |
source:
|
| 215 |
+
url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=MaziyarPanahi/calme-2.2-phi3-4b
|
| 216 |
name: Open LLM Leaderboard
|
| 217 |
---
|
| 218 |
|
| 219 |
<img src="./phi-3-instruct.webp" alt="Phi-3 Logo" width="500" style="margin-left:'auto' margin-right:'auto' display:'block'"/>
|
| 220 |
|
| 221 |
|
| 222 |
+
# MaziyarPanahi/calme-2.2-phi3-4b
|
| 223 |
|
| 224 |
This model is a fine-tune (DPO) of `microsoft/Phi-3-mini-4k-instruct` model.
|
| 225 |
|
| 226 |
# ⚡ Quantized GGUF
|
| 227 |
|
| 228 |
+
All GGUF models are available here: [MaziyarPanahi/calme-2.2-phi3-4b-GGUF](https://huggingface.co/MaziyarPanahi/calme-2.2-phi3-4b-GGUF)
|
| 229 |
|
| 230 |
# 🏆 [Open LLM Leaderboard Evaluation Results](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
|
| 231 |
+
Detailed results can be found [here](https://huggingface.co/datasets/open-llm-leaderboard/details_MaziyarPanahi__calme-2.2-phi3-4b)
|
| 232 |
|
| 233 |
| Metric |Value|
|
| 234 |
|-------------------|----:|
|
|
|
|
| 271 |
|
| 272 |
# How to use
|
| 273 |
|
| 274 |
+
You can use this model by using `MaziyarPanahi/calme-2.2-phi3-4b` as the model name in Hugging Face's
|
| 275 |
transformers library.
|
| 276 |
|
| 277 |
```python
|
|
|
|
| 279 |
from transformers import pipeline
|
| 280 |
import torch
|
| 281 |
|
| 282 |
+
model_id = "MaziyarPanahi/calme-2.2-phi3-4b"
|
| 283 |
|
| 284 |
model = AutoModelForCausalLM.from_pretrained(
|
| 285 |
model_id,
|