Phi 1.5 Chat Models
Collection
These models underwent supervised fine-tuning and direct preference optimization for instruction following on top of Microsoft's Phi 1.5 base LLM • 3 items • Updated • 1
How to use rasyosef/phi-1_5-sft with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="rasyosef/phi-1_5-sft")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("rasyosef/phi-1_5-sft")
model = AutoModelForCausalLM.from_pretrained("rasyosef/phi-1_5-sft")
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]:]))How to use rasyosef/phi-1_5-sft with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "rasyosef/phi-1_5-sft"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "rasyosef/phi-1_5-sft",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/rasyosef/phi-1_5-sft
How to use rasyosef/phi-1_5-sft with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "rasyosef/phi-1_5-sft" \
--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": "rasyosef/phi-1_5-sft",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "rasyosef/phi-1_5-sft" \
--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": "rasyosef/phi-1_5-sft",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use rasyosef/phi-1_5-sft with Docker Model Runner:
docker model run hf.co/rasyosef/phi-1_5-sft
This model is a fine-tuned version of microsoft/phi-1_5 on the generator dataset. It achieves the following results on the evaluation set:
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 1.7865 | 0.0831 | 275 | 1.4033 |
| 1.3614 | 0.1663 | 550 | 1.3218 |
| 1.2986 | 0.2494 | 825 | 1.2788 |
| 1.2667 | 0.3325 | 1100 | 1.2531 |
| 1.2405 | 0.4157 | 1375 | 1.2376 |
| 1.2239 | 0.4988 | 1650 | 1.2237 |
| 1.2078 | 0.5819 | 1925 | 1.2122 |
| 1.2114 | 0.6651 | 2200 | 1.2005 |
| 1.2028 | 0.7482 | 2475 | 1.1915 |
| 1.173 | 0.8313 | 2750 | 1.1833 |
| 1.1782 | 0.9144 | 3025 | 1.1776 |
| 1.1805 | 0.9976 | 3300 | 1.1720 |
| 1.0112 | 1.0807 | 3575 | 1.1817 |
| 0.9988 | 1.1638 | 3850 | 1.1791 |
| 0.9919 | 1.2470 | 4125 | 1.1786 |
| 0.9886 | 1.3301 | 4400 | 1.1768 |
| 0.9904 | 1.4132 | 4675 | 1.1763 |
| 1.001 | 1.4964 | 4950 | 1.1756 |
| 0.9979 | 1.5795 | 5225 | 1.1751 |
| 0.9858 | 1.6626 | 5500 | 1.1750 |
| 0.9975 | 1.7458 | 5775 | 1.1750 |
| 0.9924 | 1.8289 | 6050 | 1.1750 |
| 0.9978 | 1.9120 | 6325 | 1.1750 |
| 0.9892 | 1.9952 | 6600 | 1.1750 |