Text Generation
Transformers
ONNX
Safetensors
English
llama
alignment-handbook
trl
sft
conversational
text-generation-inference
Instructions to use HuggingFaceTB/SmolLM-1.7B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HuggingFaceTB/SmolLM-1.7B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HuggingFaceTB/SmolLM-1.7B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("HuggingFaceTB/SmolLM-1.7B-Instruct") model = AutoModelForCausalLM.from_pretrained("HuggingFaceTB/SmolLM-1.7B-Instruct") 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 Settings
- vLLM
How to use HuggingFaceTB/SmolLM-1.7B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HuggingFaceTB/SmolLM-1.7B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HuggingFaceTB/SmolLM-1.7B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/HuggingFaceTB/SmolLM-1.7B-Instruct
- SGLang
How to use HuggingFaceTB/SmolLM-1.7B-Instruct 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 "HuggingFaceTB/SmolLM-1.7B-Instruct" \ --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": "HuggingFaceTB/SmolLM-1.7B-Instruct", "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 "HuggingFaceTB/SmolLM-1.7B-Instruct" \ --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": "HuggingFaceTB/SmolLM-1.7B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use HuggingFaceTB/SmolLM-1.7B-Instruct with Docker Model Runner:
docker model run hf.co/HuggingFaceTB/SmolLM-1.7B-Instruct
End of training
Browse files
README.md
CHANGED
|
@@ -18,20 +18,20 @@ model-index:
|
|
| 18 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
| 19 |
should probably proofread and complete it, then remove this comment. -->
|
| 20 |
|
| 21 |
-
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="200" height="32"/>](https://wandb.ai/loubnabnl/huggingface/runs/
|
| 22 |
# cosmo2-1.7B-webinst-sc2-dpo-helpsteer-ep1
|
| 23 |
|
| 24 |
This model is a fine-tuned version of [HuggingFaceTB/cosmo2-1.7B-webinst-sc2](https://huggingface.co/HuggingFaceTB/cosmo2-1.7B-webinst-sc2) on the HuggingFaceTB/Helpsteer dataset.
|
| 25 |
It achieves the following results on the evaluation set:
|
| 26 |
-
- Loss: 0.
|
| 27 |
-
- Rewards/chosen: -0.
|
| 28 |
-
- Rewards/rejected: -0.
|
| 29 |
-
- Rewards/accuracies: 0.
|
| 30 |
-
- Rewards/margins: 0.
|
| 31 |
-
- Logps/rejected: -149.
|
| 32 |
-
- Logps/chosen: -121.
|
| 33 |
-
- Logits/rejected: 0.
|
| 34 |
-
- Logits/chosen: 0.
|
| 35 |
|
| 36 |
## Model description
|
| 37 |
|
|
|
|
| 18 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
| 19 |
should probably proofread and complete it, then remove this comment. -->
|
| 20 |
|
| 21 |
+
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="200" height="32"/>](https://wandb.ai/loubnabnl/huggingface/runs/ellmeibr)
|
| 22 |
# cosmo2-1.7B-webinst-sc2-dpo-helpsteer-ep1
|
| 23 |
|
| 24 |
This model is a fine-tuned version of [HuggingFaceTB/cosmo2-1.7B-webinst-sc2](https://huggingface.co/HuggingFaceTB/cosmo2-1.7B-webinst-sc2) on the HuggingFaceTB/Helpsteer dataset.
|
| 25 |
It achieves the following results on the evaluation set:
|
| 26 |
+
- Loss: 0.6672
|
| 27 |
+
- Rewards/chosen: -0.0466
|
| 28 |
+
- Rewards/rejected: -0.0933
|
| 29 |
+
- Rewards/accuracies: 0.5500
|
| 30 |
+
- Rewards/margins: 0.0467
|
| 31 |
+
- Logps/rejected: -149.4311
|
| 32 |
+
- Logps/chosen: -121.9851
|
| 33 |
+
- Logits/rejected: 0.8632
|
| 34 |
+
- Logits/chosen: 0.9551
|
| 35 |
|
| 36 |
## Model description
|
| 37 |
|
all_results.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
{
|
| 2 |
"epoch": 0.9872958257713249,
|
| 3 |
-
"eval_logits/chosen": 0.
|
| 4 |
-
"eval_logits/rejected": 0.
|
| 5 |
-
"eval_logps/chosen": -121.
|
| 6 |
-
"eval_logps/rejected": -149.
|
| 7 |
-
"eval_loss": 0.
|
| 8 |
-
"eval_rewards/accuracies": 0.
|
| 9 |
-
"eval_rewards/chosen": -0.
|
| 10 |
-
"eval_rewards/margins": 0.
|
| 11 |
-
"eval_rewards/rejected": -0.
|
| 12 |
-
"eval_runtime": 4.
|
| 13 |
"eval_samples": 464,
|
| 14 |
-
"eval_samples_per_second":
|
| 15 |
-
"eval_steps_per_second": 3.
|
| 16 |
"total_flos": 0.0,
|
| 17 |
"train_loss": 0.6753217893488267,
|
| 18 |
"train_runtime": 321.7901,
|
|
|
|
| 1 |
{
|
| 2 |
"epoch": 0.9872958257713249,
|
| 3 |
+
"eval_logits/chosen": 0.9550817608833313,
|
| 4 |
+
"eval_logits/rejected": 0.8631864190101624,
|
| 5 |
+
"eval_logps/chosen": -121.98506164550781,
|
| 6 |
+
"eval_logps/rejected": -149.43112182617188,
|
| 7 |
+
"eval_loss": 0.6671856641769409,
|
| 8 |
+
"eval_rewards/accuracies": 0.550000011920929,
|
| 9 |
+
"eval_rewards/chosen": -0.0465608611702919,
|
| 10 |
+
"eval_rewards/margins": 0.04670196771621704,
|
| 11 |
+
"eval_rewards/rejected": -0.09326283633708954,
|
| 12 |
+
"eval_runtime": 4.6203,
|
| 13 |
"eval_samples": 464,
|
| 14 |
+
"eval_samples_per_second": 100.425,
|
| 15 |
+
"eval_steps_per_second": 3.247,
|
| 16 |
"total_flos": 0.0,
|
| 17 |
"train_loss": 0.6753217893488267,
|
| 18 |
"train_runtime": 321.7901,
|
eval_results.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
| 1 |
{
|
| 2 |
"epoch": 0.9872958257713249,
|
| 3 |
-
"eval_logits/chosen": 0.
|
| 4 |
-
"eval_logits/rejected": 0.
|
| 5 |
-
"eval_logps/chosen": -121.
|
| 6 |
-
"eval_logps/rejected": -149.
|
| 7 |
-
"eval_loss": 0.
|
| 8 |
-
"eval_rewards/accuracies": 0.
|
| 9 |
-
"eval_rewards/chosen": -0.
|
| 10 |
-
"eval_rewards/margins": 0.
|
| 11 |
-
"eval_rewards/rejected": -0.
|
| 12 |
-
"eval_runtime": 4.
|
| 13 |
"eval_samples": 464,
|
| 14 |
-
"eval_samples_per_second":
|
| 15 |
-
"eval_steps_per_second": 3.
|
| 16 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"epoch": 0.9872958257713249,
|
| 3 |
+
"eval_logits/chosen": 0.9550817608833313,
|
| 4 |
+
"eval_logits/rejected": 0.8631864190101624,
|
| 5 |
+
"eval_logps/chosen": -121.98506164550781,
|
| 6 |
+
"eval_logps/rejected": -149.43112182617188,
|
| 7 |
+
"eval_loss": 0.6671856641769409,
|
| 8 |
+
"eval_rewards/accuracies": 0.550000011920929,
|
| 9 |
+
"eval_rewards/chosen": -0.0465608611702919,
|
| 10 |
+
"eval_rewards/margins": 0.04670196771621704,
|
| 11 |
+
"eval_rewards/rejected": -0.09326283633708954,
|
| 12 |
+
"eval_runtime": 4.6203,
|
| 13 |
"eval_samples": 464,
|
| 14 |
+
"eval_samples_per_second": 100.425,
|
| 15 |
+
"eval_steps_per_second": 3.247
|
| 16 |
}
|
runs/Jul15_23-01-52_ip-26-0-171-168/events.out.tfevents.1721085183.ip-26-0-171-168.1537695.1
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:27a6a863f4bf58d6242e050e5e56402f3611cf866ad775259a318e644ad89c3d
|
| 3 |
+
size 815
|