Text Generation
Transformers
TensorBoard
Safetensors
llama
Generated from Trainer
smol-course
module_1
trl
dpo
conversational
text-generation-inference
Instructions to use MUTSC/SmolLM2-FT-DPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MUTSC/SmolLM2-FT-DPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MUTSC/SmolLM2-FT-DPO") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MUTSC/SmolLM2-FT-DPO") model = AutoModelForCausalLM.from_pretrained("MUTSC/SmolLM2-FT-DPO") 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 MUTSC/SmolLM2-FT-DPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MUTSC/SmolLM2-FT-DPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MUTSC/SmolLM2-FT-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MUTSC/SmolLM2-FT-DPO
- SGLang
How to use MUTSC/SmolLM2-FT-DPO 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 "MUTSC/SmolLM2-FT-DPO" \ --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": "MUTSC/SmolLM2-FT-DPO", "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 "MUTSC/SmolLM2-FT-DPO" \ --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": "MUTSC/SmolLM2-FT-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MUTSC/SmolLM2-FT-DPO with Docker Model Runner:
docker model run hf.co/MUTSC/SmolLM2-FT-DPO
End of training
Browse files- README.md +6 -6
- config.json +1 -2
- generation_config.json +1 -1
- model.safetensors +1 -1
- runs/Apr15_11-15-36_794992d02057/events.out.tfevents.1744716197.794992d02057.316.0 +3 -0
- training_args.bin +2 -2
README.md
CHANGED
|
@@ -29,18 +29,18 @@ print(output["generated_text"])
|
|
| 29 |
|
| 30 |
## Training procedure
|
| 31 |
|
| 32 |
-
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/tdva-etsit-etsit-universidad-politecnica-de-madrid/huggingface/runs/
|
| 33 |
|
| 34 |
|
| 35 |
This model was trained with DPO, a method introduced in [Direct Preference Optimization: Your Language Model is Secretly a Reward Model](https://huggingface.co/papers/2305.18290).
|
| 36 |
|
| 37 |
### Framework versions
|
| 38 |
|
| 39 |
-
- TRL: 0.
|
| 40 |
-
- Transformers: 4.
|
| 41 |
-
- Pytorch: 2.
|
| 42 |
-
- Datasets: 3.
|
| 43 |
-
- Tokenizers: 0.21.
|
| 44 |
|
| 45 |
## Citations
|
| 46 |
|
|
|
|
| 29 |
|
| 30 |
## Training procedure
|
| 31 |
|
| 32 |
+
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/tdva-etsit-etsit-universidad-politecnica-de-madrid/huggingface/runs/xx90d4xp)
|
| 33 |
|
| 34 |
|
| 35 |
This model was trained with DPO, a method introduced in [Direct Preference Optimization: Your Language Model is Secretly a Reward Model](https://huggingface.co/papers/2305.18290).
|
| 36 |
|
| 37 |
### Framework versions
|
| 38 |
|
| 39 |
+
- TRL: 0.16.1
|
| 40 |
+
- Transformers: 4.51.1
|
| 41 |
+
- Pytorch: 2.6.0+cu124
|
| 42 |
+
- Datasets: 3.5.0
|
| 43 |
+
- Tokenizers: 0.21.1
|
| 44 |
|
| 45 |
## Citations
|
| 46 |
|
config.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "Bipul8765/SmolLM2-FT-MyDataset",
|
| 3 |
"architectures": [
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|
|
@@ -27,7 +26,7 @@
|
|
| 27 |
"rope_theta": 100000,
|
| 28 |
"tie_word_embeddings": true,
|
| 29 |
"torch_dtype": "float32",
|
| 30 |
-
"transformers_version": "4.
|
| 31 |
"use_cache": false,
|
| 32 |
"vocab_size": 49152
|
| 33 |
}
|
|
|
|
| 1 |
{
|
|
|
|
| 2 |
"architectures": [
|
| 3 |
"LlamaForCausalLM"
|
| 4 |
],
|
|
|
|
| 26 |
"rope_theta": 100000,
|
| 27 |
"tie_word_embeddings": true,
|
| 28 |
"torch_dtype": "float32",
|
| 29 |
+
"transformers_version": "4.51.1",
|
| 30 |
"use_cache": false,
|
| 31 |
"vocab_size": 49152
|
| 32 |
}
|
generation_config.json
CHANGED
|
@@ -3,5 +3,5 @@
|
|
| 3 |
"bos_token_id": 1,
|
| 4 |
"eos_token_id": 2,
|
| 5 |
"pad_token_id": 2,
|
| 6 |
-
"transformers_version": "4.
|
| 7 |
}
|
|
|
|
| 3 |
"bos_token_id": 1,
|
| 4 |
"eos_token_id": 2,
|
| 5 |
"pad_token_id": 2,
|
| 6 |
+
"transformers_version": "4.51.1"
|
| 7 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 538090408
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:22c240c86f5f39b017382fe34df765b359abf2717448ef52dd48225c78c80d27
|
| 3 |
size 538090408
|
runs/Apr15_11-15-36_794992d02057/events.out.tfevents.1744716197.794992d02057.316.0
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1b0200023bf5579e5e52b9526272db5806049e2320a41f16a2394c617c7d653c
|
| 3 |
+
size 142459
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7b0d07b9d78b9da84ff7c173486953a7ac569e2f222eaa04754d3821addbdf33
|
| 3 |
+
size 6200
|