Text Generation
Transformers
TensorBoard
ONNX
Safetensors
Transformers.js
English
llama
conversational
text-generation-inference
Instructions to use HuggingFaceTB/SmolLM2-360M-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HuggingFaceTB/SmolLM2-360M-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HuggingFaceTB/SmolLM2-360M-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("HuggingFaceTB/SmolLM2-360M-Instruct") model = AutoModelForCausalLM.from_pretrained("HuggingFaceTB/SmolLM2-360M-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]:])) - Transformers.js
How to use HuggingFaceTB/SmolLM2-360M-Instruct with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-generation', 'HuggingFaceTB/SmolLM2-360M-Instruct'); - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use HuggingFaceTB/SmolLM2-360M-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HuggingFaceTB/SmolLM2-360M-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/SmolLM2-360M-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/HuggingFaceTB/SmolLM2-360M-Instruct
- SGLang
How to use HuggingFaceTB/SmolLM2-360M-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/SmolLM2-360M-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/SmolLM2-360M-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/SmolLM2-360M-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/SmolLM2-360M-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use HuggingFaceTB/SmolLM2-360M-Instruct with Docker Model Runner:
docker model run hf.co/HuggingFaceTB/SmolLM2-360M-Instruct
Adding Evaluation Results
#6
by leaderboard-pr-bot - opened
README.md
CHANGED
|
@@ -1,8 +1,103 @@
|
|
| 1 |
---
|
| 2 |
-
library_name: transformers
|
| 3 |
-
license: apache-2.0
|
| 4 |
language:
|
| 5 |
- en
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
---
|
| 7 |
|
| 8 |
|
|
@@ -121,4 +216,17 @@ SmolLM2 models primarily understand and generate content in English. They can pr
|
|
| 121 |
author={Loubna Ben Allal and Anton Lozhkov and Elie Bakouch and Gabriel Martín Blázquez and Lewis Tunstall and Agustín Piqueres and Andres Marafioti and Cyril Zakka and Leandro von Werra and Thomas Wolf},
|
| 122 |
year={2024},
|
| 123 |
}
|
| 124 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
|
|
|
|
|
|
| 2 |
language:
|
| 3 |
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
library_name: transformers
|
| 6 |
+
model-index:
|
| 7 |
+
- name: SmolLM2-360M-Instruct
|
| 8 |
+
results:
|
| 9 |
+
- task:
|
| 10 |
+
type: text-generation
|
| 11 |
+
name: Text Generation
|
| 12 |
+
dataset:
|
| 13 |
+
name: IFEval (0-Shot)
|
| 14 |
+
type: HuggingFaceH4/ifeval
|
| 15 |
+
args:
|
| 16 |
+
num_few_shot: 0
|
| 17 |
+
metrics:
|
| 18 |
+
- type: inst_level_strict_acc and prompt_level_strict_acc
|
| 19 |
+
value: 8.3
|
| 20 |
+
name: strict accuracy
|
| 21 |
+
source:
|
| 22 |
+
url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=HuggingFaceTB/SmolLM2-360M-Instruct
|
| 23 |
+
name: Open LLM Leaderboard
|
| 24 |
+
- task:
|
| 25 |
+
type: text-generation
|
| 26 |
+
name: Text Generation
|
| 27 |
+
dataset:
|
| 28 |
+
name: BBH (3-Shot)
|
| 29 |
+
type: BBH
|
| 30 |
+
args:
|
| 31 |
+
num_few_shot: 3
|
| 32 |
+
metrics:
|
| 33 |
+
- type: acc_norm
|
| 34 |
+
value: 3.3
|
| 35 |
+
name: normalized accuracy
|
| 36 |
+
source:
|
| 37 |
+
url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=HuggingFaceTB/SmolLM2-360M-Instruct
|
| 38 |
+
name: Open LLM Leaderboard
|
| 39 |
+
- task:
|
| 40 |
+
type: text-generation
|
| 41 |
+
name: Text Generation
|
| 42 |
+
dataset:
|
| 43 |
+
name: MATH Lvl 5 (4-Shot)
|
| 44 |
+
type: hendrycks/competition_math
|
| 45 |
+
args:
|
| 46 |
+
num_few_shot: 4
|
| 47 |
+
metrics:
|
| 48 |
+
- type: exact_match
|
| 49 |
+
value: 0.83
|
| 50 |
+
name: exact match
|
| 51 |
+
source:
|
| 52 |
+
url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=HuggingFaceTB/SmolLM2-360M-Instruct
|
| 53 |
+
name: Open LLM Leaderboard
|
| 54 |
+
- task:
|
| 55 |
+
type: text-generation
|
| 56 |
+
name: Text Generation
|
| 57 |
+
dataset:
|
| 58 |
+
name: GPQA (0-shot)
|
| 59 |
+
type: Idavidrein/gpqa
|
| 60 |
+
args:
|
| 61 |
+
num_few_shot: 0
|
| 62 |
+
metrics:
|
| 63 |
+
- type: acc_norm
|
| 64 |
+
value: 2.01
|
| 65 |
+
name: acc_norm
|
| 66 |
+
source:
|
| 67 |
+
url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=HuggingFaceTB/SmolLM2-360M-Instruct
|
| 68 |
+
name: Open LLM Leaderboard
|
| 69 |
+
- task:
|
| 70 |
+
type: text-generation
|
| 71 |
+
name: Text Generation
|
| 72 |
+
dataset:
|
| 73 |
+
name: MuSR (0-shot)
|
| 74 |
+
type: TAUR-Lab/MuSR
|
| 75 |
+
args:
|
| 76 |
+
num_few_shot: 0
|
| 77 |
+
metrics:
|
| 78 |
+
- type: acc_norm
|
| 79 |
+
value: 2.75
|
| 80 |
+
name: acc_norm
|
| 81 |
+
source:
|
| 82 |
+
url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=HuggingFaceTB/SmolLM2-360M-Instruct
|
| 83 |
+
name: Open LLM Leaderboard
|
| 84 |
+
- task:
|
| 85 |
+
type: text-generation
|
| 86 |
+
name: Text Generation
|
| 87 |
+
dataset:
|
| 88 |
+
name: MMLU-PRO (5-shot)
|
| 89 |
+
type: TIGER-Lab/MMLU-Pro
|
| 90 |
+
config: main
|
| 91 |
+
split: test
|
| 92 |
+
args:
|
| 93 |
+
num_few_shot: 5
|
| 94 |
+
metrics:
|
| 95 |
+
- type: acc
|
| 96 |
+
value: 1.4
|
| 97 |
+
name: accuracy
|
| 98 |
+
source:
|
| 99 |
+
url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=HuggingFaceTB/SmolLM2-360M-Instruct
|
| 100 |
+
name: Open LLM Leaderboard
|
| 101 |
---
|
| 102 |
|
| 103 |
|
|
|
|
| 216 |
author={Loubna Ben Allal and Anton Lozhkov and Elie Bakouch and Gabriel Martín Blázquez and Lewis Tunstall and Agustín Piqueres and Andres Marafioti and Cyril Zakka and Leandro von Werra and Thomas Wolf},
|
| 217 |
year={2024},
|
| 218 |
}
|
| 219 |
+
```
|
| 220 |
+
# [Open LLM Leaderboard Evaluation Results](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard)
|
| 221 |
+
Detailed results can be found [here](https://huggingface.co/datasets/open-llm-leaderboard/details_HuggingFaceTB__SmolLM2-360M-Instruct)
|
| 222 |
+
|
| 223 |
+
| Metric |Value|
|
| 224 |
+
|-------------------|----:|
|
| 225 |
+
|Avg. | 3.10|
|
| 226 |
+
|IFEval (0-Shot) | 8.30|
|
| 227 |
+
|BBH (3-Shot) | 3.30|
|
| 228 |
+
|MATH Lvl 5 (4-Shot)| 0.83|
|
| 229 |
+
|GPQA (0-shot) | 2.01|
|
| 230 |
+
|MuSR (0-shot) | 2.75|
|
| 231 |
+
|MMLU-PRO (5-shot) | 1.40|
|
| 232 |
+
|