Text Generation
Transformers
Safetensors
llama
Generated from Trainer
module_1
smol-course
sft
trl
conversational
text-generation-inference
Instructions to use AdrianME/SmolLM2-FT-MyDataset with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AdrianME/SmolLM2-FT-MyDataset with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AdrianME/SmolLM2-FT-MyDataset") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AdrianME/SmolLM2-FT-MyDataset") model = AutoModelForCausalLM.from_pretrained("AdrianME/SmolLM2-FT-MyDataset") 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
- vLLM
How to use AdrianME/SmolLM2-FT-MyDataset with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AdrianME/SmolLM2-FT-MyDataset" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AdrianME/SmolLM2-FT-MyDataset", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AdrianME/SmolLM2-FT-MyDataset
- SGLang
How to use AdrianME/SmolLM2-FT-MyDataset 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 "AdrianME/SmolLM2-FT-MyDataset" \ --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": "AdrianME/SmolLM2-FT-MyDataset", "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 "AdrianME/SmolLM2-FT-MyDataset" \ --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": "AdrianME/SmolLM2-FT-MyDataset", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use AdrianME/SmolLM2-FT-MyDataset with Docker Model Runner:
docker model run hf.co/AdrianME/SmolLM2-FT-MyDataset
End of training
Browse files- README.md +2 -2
- chat_template.jinja +1 -3
- model.safetensors +1 -1
- tokenizer_config.json +16 -1
README.md
CHANGED
|
@@ -4,10 +4,10 @@ library_name: transformers
|
|
| 4 |
model_name: SmolLM2-FT-MyDataset
|
| 5 |
tags:
|
| 6 |
- generated_from_trainer
|
| 7 |
-
- trl
|
| 8 |
-
- sft
|
| 9 |
- module_1
|
| 10 |
- smol-course
|
|
|
|
|
|
|
| 11 |
licence: license
|
| 12 |
---
|
| 13 |
|
|
|
|
| 4 |
model_name: SmolLM2-FT-MyDataset
|
| 5 |
tags:
|
| 6 |
- generated_from_trainer
|
|
|
|
|
|
|
| 7 |
- module_1
|
| 8 |
- smol-course
|
| 9 |
+
- sft
|
| 10 |
+
- trl
|
| 11 |
licence: license
|
| 12 |
---
|
| 13 |
|
chat_template.jinja
CHANGED
|
@@ -1,3 +1 @@
|
|
| 1 |
-
{% for message in messages %}<|im_start|>{{ message['role'] }}
|
| 2 |
-
{{ message['content'] }}<|im_end|>
|
| 3 |
-
{% endfor %}
|
|
|
|
| 1 |
+
{% for message in messages %}{% if message['role'] == 'user' %}{{ '<|im_start|>user\n' + message['content'] + '<|im_end|>\n' }}{% elif message['role'] == 'system' %}{{ '<|im_start|>system\n' + message['content'] + '<|im_end|>\n' }}{% elif message['role'] == 'assistant' %}{{ '<|im_start|>assistant\n' + message['content'] + '<|im_end|>\n' }}{% endif %}{% endfor %}
|
|
|
|
|
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 269060552
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:44dc88f1896935cc72f871fcac45107cef2c4488a5b73eb71ce5dfa334d42531
|
| 3 |
size 269060552
|
tokenizer_config.json
CHANGED
|
@@ -5,8 +5,23 @@
|
|
| 5 |
"clean_up_tokenization_spaces": false,
|
| 6 |
"eos_token": "<|endoftext|>",
|
| 7 |
"extra_special_tokens": [
|
|
|
|
| 8 |
"<|im_start|>",
|
| 9 |
-
"<|im_end|>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
],
|
| 11 |
"is_local": false,
|
| 12 |
"model_max_length": 8192,
|
|
|
|
| 5 |
"clean_up_tokenization_spaces": false,
|
| 6 |
"eos_token": "<|endoftext|>",
|
| 7 |
"extra_special_tokens": [
|
| 8 |
+
"<|endoftext|>",
|
| 9 |
"<|im_start|>",
|
| 10 |
+
"<|im_end|>",
|
| 11 |
+
"<repo_name>",
|
| 12 |
+
"<reponame>",
|
| 13 |
+
"<file_sep>",
|
| 14 |
+
"<filename>",
|
| 15 |
+
"<gh_stars>",
|
| 16 |
+
"<issue_start>",
|
| 17 |
+
"<issue_comment>",
|
| 18 |
+
"<issue_closed>",
|
| 19 |
+
"<jupyter_start>",
|
| 20 |
+
"<jupyter_text>",
|
| 21 |
+
"<jupyter_code>",
|
| 22 |
+
"<jupyter_output>",
|
| 23 |
+
"<jupyter_script>",
|
| 24 |
+
"<empty_output>"
|
| 25 |
],
|
| 26 |
"is_local": false,
|
| 27 |
"model_max_length": 8192,
|