Text Generation
Transformers
Safetensors
English
llama
humanized
smollm
conversational
text-generation-inference
Instructions to use AssistantsLab/SmolLM2-135M-humanized with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AssistantsLab/SmolLM2-135M-humanized with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AssistantsLab/SmolLM2-135M-humanized") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AssistantsLab/SmolLM2-135M-humanized") model = AutoModelForCausalLM.from_pretrained("AssistantsLab/SmolLM2-135M-humanized", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AssistantsLab/SmolLM2-135M-humanized with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AssistantsLab/SmolLM2-135M-humanized" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AssistantsLab/SmolLM2-135M-humanized", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AssistantsLab/SmolLM2-135M-humanized
- SGLang
How to use AssistantsLab/SmolLM2-135M-humanized 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 "AssistantsLab/SmolLM2-135M-humanized" \ --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": "AssistantsLab/SmolLM2-135M-humanized", "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 "AssistantsLab/SmolLM2-135M-humanized" \ --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": "AssistantsLab/SmolLM2-135M-humanized", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use AssistantsLab/SmolLM2-135M-humanized with Docker Model Runner:
docker model run hf.co/AssistantsLab/SmolLM2-135M-humanized
Update README.md
Browse files
README.md
CHANGED
|
@@ -69,34 +69,21 @@ trl chat --model_name_or_path HuggingFaceTB/SmolLM2-135M-Instruct --device cpu
|
|
| 69 |
|
| 70 |
In this section, we report the evaluation results of SmolLM2. All evaluations are zero-shot unless stated otherwise, and we use [lighteval](https://github.com/huggingface/lighteval) to run them.
|
| 71 |
|
| 72 |
-
##
|
| 73 |
-
|
| 74 |
-
|
|
| 75 |
-
|:-------------------|:----------------:|:------------:|
|
| 76 |
-
|
|
| 77 |
-
| ARC (
|
| 78 |
-
|
|
| 79 |
-
|
|
| 80 |
-
|
|
| 81 |
-
|
|
| 82 |
-
|
|
| 83 |
-
|
|
| 84 |
-
|
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
## Instruction model
|
| 88 |
-
|
| 89 |
-
| Metric | SmolLM2-135M-Instruct | SmolLM-135M-Instruct |
|
| 90 |
-
|:-----------------------------|:---------------------:|:--------------------:|
|
| 91 |
-
| IFEval (Average prompt/inst) | **29.9** | 17.2 |
|
| 92 |
-
| MT-Bench | **19.8** | 16.8 |
|
| 93 |
-
| HellaSwag | **40.9** | 38.9 |
|
| 94 |
-
| ARC (Average) | **37.3** | 33.9 |
|
| 95 |
-
| PIQA | **66.3** | 64.0 |
|
| 96 |
-
| MMLU (cloze) | **29.3** | 28.3 |
|
| 97 |
-
| BBH (3-shot) | **28.2** | 25.2 |
|
| 98 |
-
| GSM8K (5-shot) | 1.4 | 1.4 |
|
| 99 |
-
|
| 100 |
|
| 101 |
|
| 102 |
## Limitations
|
|
|
|
| 69 |
|
| 70 |
In this section, we report the evaluation results of SmolLM2. All evaluations are zero-shot unless stated otherwise, and we use [lighteval](https://github.com/huggingface/lighteval) to run them.
|
| 71 |
|
| 72 |
+
## Instruction model Vs. Humanized model
|
| 73 |
+
|
| 74 |
+
| Metric | SmolLM2-135M-Instruct | SmolLM2-135M-Humanized |
|
| 75 |
+
|:-----------------------------|:---------------------:|:----------------------:|
|
| 76 |
+
| MMLU | **23.1** | 23.1 |
|
| 77 |
+
| ARC (Easy) | **54.3** | 50.2 |
|
| 78 |
+
| ARC (Challenge) | **26.1** | 25.3 |
|
| 79 |
+
| HellaSwag | **43.0** | 41.6 |
|
| 80 |
+
| PIQA | **67.2** | 66.2 |
|
| 81 |
+
| WinoGrande | **52.5** | 52.2 |
|
| 82 |
+
| TriviaQA | **0.3** | 0.1 |
|
| 83 |
+
| GSM8K | 0.2 | **0.5** |
|
| 84 |
+
| OpenBookQA | **32.6** | 32.0 |
|
| 85 |
+
| CommonSenseQA | **4.8** | 2.2 |
|
| 86 |
+
| QuAC (F1) | **14.1** | 11.0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
|
| 88 |
|
| 89 |
## Limitations
|