Instructions to use onnx-internal-testing/tiny-random-SmolLM3ForCausalLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use onnx-internal-testing/tiny-random-SmolLM3ForCausalLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="onnx-internal-testing/tiny-random-SmolLM3ForCausalLM") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("onnx-internal-testing/tiny-random-SmolLM3ForCausalLM") model = AutoModelForCausalLM.from_pretrained("onnx-internal-testing/tiny-random-SmolLM3ForCausalLM") 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 onnx-internal-testing/tiny-random-SmolLM3ForCausalLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "onnx-internal-testing/tiny-random-SmolLM3ForCausalLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "onnx-internal-testing/tiny-random-SmolLM3ForCausalLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/onnx-internal-testing/tiny-random-SmolLM3ForCausalLM
- SGLang
How to use onnx-internal-testing/tiny-random-SmolLM3ForCausalLM 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 "onnx-internal-testing/tiny-random-SmolLM3ForCausalLM" \ --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": "onnx-internal-testing/tiny-random-SmolLM3ForCausalLM", "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 "onnx-internal-testing/tiny-random-SmolLM3ForCausalLM" \ --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": "onnx-internal-testing/tiny-random-SmolLM3ForCausalLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use onnx-internal-testing/tiny-random-SmolLM3ForCausalLM with Docker Model Runner:
docker model run hf.co/onnx-internal-testing/tiny-random-SmolLM3ForCausalLM
Update config.json
#1
by IlyasMoutawwakil HF Staff - opened
- config.json +1 -69
config.json
CHANGED
|
@@ -11,40 +11,6 @@
|
|
| 11 |
"initializer_range": 0.02,
|
| 12 |
"intermediate_size": 32,
|
| 13 |
"layer_types": [
|
| 14 |
-
"full_attention",
|
| 15 |
-
"full_attention",
|
| 16 |
-
"full_attention",
|
| 17 |
-
"full_attention",
|
| 18 |
-
"full_attention",
|
| 19 |
-
"full_attention",
|
| 20 |
-
"full_attention",
|
| 21 |
-
"full_attention",
|
| 22 |
-
"full_attention",
|
| 23 |
-
"full_attention",
|
| 24 |
-
"full_attention",
|
| 25 |
-
"full_attention",
|
| 26 |
-
"full_attention",
|
| 27 |
-
"full_attention",
|
| 28 |
-
"full_attention",
|
| 29 |
-
"full_attention",
|
| 30 |
-
"full_attention",
|
| 31 |
-
"full_attention",
|
| 32 |
-
"full_attention",
|
| 33 |
-
"full_attention",
|
| 34 |
-
"full_attention",
|
| 35 |
-
"full_attention",
|
| 36 |
-
"full_attention",
|
| 37 |
-
"full_attention",
|
| 38 |
-
"full_attention",
|
| 39 |
-
"full_attention",
|
| 40 |
-
"full_attention",
|
| 41 |
-
"full_attention",
|
| 42 |
-
"full_attention",
|
| 43 |
-
"full_attention",
|
| 44 |
-
"full_attention",
|
| 45 |
-
"full_attention",
|
| 46 |
-
"full_attention",
|
| 47 |
-
"full_attention",
|
| 48 |
"full_attention",
|
| 49 |
"full_attention"
|
| 50 |
],
|
|
@@ -55,41 +21,7 @@
|
|
| 55 |
"no_rope_layer_interval": 4,
|
| 56 |
"no_rope_layers": [
|
| 57 |
1,
|
| 58 |
-
1
|
| 59 |
-
1,
|
| 60 |
-
0,
|
| 61 |
-
1,
|
| 62 |
-
1,
|
| 63 |
-
1,
|
| 64 |
-
0,
|
| 65 |
-
1,
|
| 66 |
-
1,
|
| 67 |
-
1,
|
| 68 |
-
0,
|
| 69 |
-
1,
|
| 70 |
-
1,
|
| 71 |
-
1,
|
| 72 |
-
0,
|
| 73 |
-
1,
|
| 74 |
-
1,
|
| 75 |
-
1,
|
| 76 |
-
0,
|
| 77 |
-
1,
|
| 78 |
-
1,
|
| 79 |
-
1,
|
| 80 |
-
0,
|
| 81 |
-
1,
|
| 82 |
-
1,
|
| 83 |
-
1,
|
| 84 |
-
0,
|
| 85 |
-
1,
|
| 86 |
-
1,
|
| 87 |
-
1,
|
| 88 |
-
0,
|
| 89 |
-
1,
|
| 90 |
-
1,
|
| 91 |
-
1,
|
| 92 |
-
0
|
| 93 |
],
|
| 94 |
"num_attention_heads": 4,
|
| 95 |
"num_hidden_layers": 2,
|
|
|
|
| 11 |
"initializer_range": 0.02,
|
| 12 |
"intermediate_size": 32,
|
| 13 |
"layer_types": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
"full_attention",
|
| 15 |
"full_attention"
|
| 16 |
],
|
|
|
|
| 21 |
"no_rope_layer_interval": 4,
|
| 22 |
"no_rope_layers": [
|
| 23 |
1,
|
| 24 |
+
1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
],
|
| 26 |
"num_attention_heads": 4,
|
| 27 |
"num_hidden_layers": 2,
|