Tuned
Collection
Soft-prompted models • 4 items • Updated
How to use PracticalWork/SmolLM2-1.7B-Instruct-tuned with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("HuggingFaceTB/SmolLM2-1.7B-Instruct")
model = PeftModel.from_pretrained(base_model, "PracticalWork/SmolLM2-1.7B-Instruct-tuned")How to use PracticalWork/SmolLM2-1.7B-Instruct-tuned with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="PracticalWork/SmolLM2-1.7B-Instruct-tuned")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("PracticalWork/SmolLM2-1.7B-Instruct-tuned", dtype="auto")How to use PracticalWork/SmolLM2-1.7B-Instruct-tuned with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "PracticalWork/SmolLM2-1.7B-Instruct-tuned"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "PracticalWork/SmolLM2-1.7B-Instruct-tuned",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/PracticalWork/SmolLM2-1.7B-Instruct-tuned
How to use PracticalWork/SmolLM2-1.7B-Instruct-tuned with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "PracticalWork/SmolLM2-1.7B-Instruct-tuned" \
--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": "PracticalWork/SmolLM2-1.7B-Instruct-tuned",
"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 "PracticalWork/SmolLM2-1.7B-Instruct-tuned" \
--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": "PracticalWork/SmolLM2-1.7B-Instruct-tuned",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use PracticalWork/SmolLM2-1.7B-Instruct-tuned with Docker Model Runner:
docker model run hf.co/PracticalWork/SmolLM2-1.7B-Instruct-tuned
This model is a fine-tuned version of HuggingFaceTB/SmolLM2-1.7B-Instruct on an unknown dataset. It achieves the following results on the evaluation set:
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Perplexity |
|---|---|---|---|---|
| No log | 0 | 0 | 3.1117 | 22.4598 |
| No log | 0.6011 | 333 | 1.5821 | 4.8650 |
| 1.6345 | 1.2022 | 666 | 1.5242 | 4.5915 |
| 1.6345 | 1.8032 | 999 | 1.4899 | 4.4364 |
| 1.4894 | 2.4043 | 1332 | 1.4634 | 4.3205 |
| 1.4894 | 3 | 1664 | 1.4442 | 4.2384 |
Base model
HuggingFaceTB/SmolLM2-1.7B