Text Generation
Transformers
Safetensors
English
llama
humanized
smollm
conversational
text-generation-inference
Instructions to use AssistantsLab/SmolLM2-360M-humanized with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AssistantsLab/SmolLM2-360M-humanized with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AssistantsLab/SmolLM2-360M-humanized") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AssistantsLab/SmolLM2-360M-humanized") model = AutoModelForCausalLM.from_pretrained("AssistantsLab/SmolLM2-360M-humanized") 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 AssistantsLab/SmolLM2-360M-humanized with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AssistantsLab/SmolLM2-360M-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-360M-humanized", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AssistantsLab/SmolLM2-360M-humanized
- SGLang
How to use AssistantsLab/SmolLM2-360M-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-360M-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-360M-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-360M-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-360M-humanized", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use AssistantsLab/SmolLM2-360M-humanized with Docker Model Runner:
docker model run hf.co/AssistantsLab/SmolLM2-360M-humanized
Upload 9 files
Browse files- config.json +8 -8
- generation_config.json +1 -1
- model.safetensors +2 -2
- tokenizer.json +2 -14
- training_args.bin +1 -1
config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "HuggingFaceTB/SmolLM2-
|
| 3 |
"architectures": [
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|
|
@@ -9,16 +9,16 @@
|
|
| 9 |
"eos_token_id": 2,
|
| 10 |
"head_dim": 64,
|
| 11 |
"hidden_act": "silu",
|
| 12 |
-
"hidden_size":
|
| 13 |
-
"initializer_range": 0.
|
| 14 |
-
"intermediate_size":
|
| 15 |
"is_llama_config": true,
|
| 16 |
"max_position_embeddings": 8192,
|
| 17 |
"mlp_bias": false,
|
| 18 |
"model_type": "llama",
|
| 19 |
-
"num_attention_heads":
|
| 20 |
-
"num_hidden_layers":
|
| 21 |
-
"num_key_value_heads":
|
| 22 |
"pad_token_id": 2,
|
| 23 |
"pretraining_tp": 1,
|
| 24 |
"rms_norm_eps": 1e-05,
|
|
@@ -33,7 +33,7 @@
|
|
| 33 |
"q4f16": "float16"
|
| 34 |
}
|
| 35 |
},
|
| 36 |
-
"transformers_version": "4.48.
|
| 37 |
"use_cache": true,
|
| 38 |
"vocab_size": 49152
|
| 39 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "HuggingFaceTB/SmolLM2-360M-Instruct",
|
| 3 |
"architectures": [
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|
|
|
|
| 9 |
"eos_token_id": 2,
|
| 10 |
"head_dim": 64,
|
| 11 |
"hidden_act": "silu",
|
| 12 |
+
"hidden_size": 960,
|
| 13 |
+
"initializer_range": 0.02,
|
| 14 |
+
"intermediate_size": 2560,
|
| 15 |
"is_llama_config": true,
|
| 16 |
"max_position_embeddings": 8192,
|
| 17 |
"mlp_bias": false,
|
| 18 |
"model_type": "llama",
|
| 19 |
+
"num_attention_heads": 15,
|
| 20 |
+
"num_hidden_layers": 32,
|
| 21 |
+
"num_key_value_heads": 5,
|
| 22 |
"pad_token_id": 2,
|
| 23 |
"pretraining_tp": 1,
|
| 24 |
"rms_norm_eps": 1e-05,
|
|
|
|
| 33 |
"q4f16": "float16"
|
| 34 |
}
|
| 35 |
},
|
| 36 |
+
"transformers_version": "4.48.3",
|
| 37 |
"use_cache": true,
|
| 38 |
"vocab_size": 49152
|
| 39 |
}
|
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.48.
|
| 7 |
}
|
|
|
|
| 3 |
"bos_token_id": 1,
|
| 4 |
"eos_token_id": 2,
|
| 5 |
"pad_token_id": 2,
|
| 6 |
+
"transformers_version": "4.48.3"
|
| 7 |
}
|
model.safetensors
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:6867677f24aa92ca496a27336e1936dcc2e334354806a69bfee7d3c960748d0f
|
| 3 |
+
size 723674912
|
tokenizer.json
CHANGED
|
@@ -1,19 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"version": "1.0",
|
| 3 |
-
"truncation":
|
| 4 |
-
|
| 5 |
-
"max_length": 8192,
|
| 6 |
-
"strategy": "LongestFirst",
|
| 7 |
-
"stride": 0
|
| 8 |
-
},
|
| 9 |
-
"padding": {
|
| 10 |
-
"strategy": "BatchLongest",
|
| 11 |
-
"direction": "Left",
|
| 12 |
-
"pad_to_multiple_of": null,
|
| 13 |
-
"pad_id": 2,
|
| 14 |
-
"pad_type_id": 0,
|
| 15 |
-
"pad_token": "<|im_end|>"
|
| 16 |
-
},
|
| 17 |
"added_tokens": [
|
| 18 |
{
|
| 19 |
"id": 0,
|
|
|
|
| 1 |
{
|
| 2 |
"version": "1.0",
|
| 3 |
+
"truncation": null,
|
| 4 |
+
"padding": null,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
"added_tokens": [
|
| 6 |
{
|
| 7 |
"id": 0,
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 6200
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8288702bf1db05beb5371c5042435c0caec211ef529e54f10857324941950ccf
|
| 3 |
size 6200
|