Instructions to use wapx/smollm2-it-ko with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use wapx/smollm2-it-ko with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="wapx/smollm2-it-ko") 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("wapx/smollm2-it-ko") model = AutoModelForCausalLM.from_pretrained("wapx/smollm2-it-ko", 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 wapx/smollm2-it-ko with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "wapx/smollm2-it-ko" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wapx/smollm2-it-ko", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/wapx/smollm2-it-ko
- SGLang
How to use wapx/smollm2-it-ko 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 "wapx/smollm2-it-ko" \ --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": "wapx/smollm2-it-ko", "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 "wapx/smollm2-it-ko" \ --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": "wapx/smollm2-it-ko", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use wapx/smollm2-it-ko with Docker Model Runner:
docker model run hf.co/wapx/smollm2-it-ko
Upload folder using huggingface_hub
Browse files- config.json +13 -10
- generation_config.json +1 -1
- model.safetensors +2 -2
config.json
CHANGED
|
@@ -8,31 +8,34 @@
|
|
| 8 |
"eos_token_id": 2,
|
| 9 |
"head_dim": 64,
|
| 10 |
"hidden_act": "silu",
|
| 11 |
-
"hidden_size":
|
| 12 |
"initializer_range": 0.02,
|
| 13 |
-
"intermediate_size":
|
| 14 |
-
"is_llama_config": true,
|
| 15 |
"max_position_embeddings": 8192,
|
| 16 |
"mlp_bias": false,
|
| 17 |
"model_type": "llama",
|
| 18 |
-
"num_attention_heads":
|
| 19 |
-
"num_hidden_layers":
|
| 20 |
-
"num_key_value_heads":
|
| 21 |
"pad_token_id": 2,
|
| 22 |
"pretraining_tp": 1,
|
| 23 |
"rms_norm_eps": 1e-05,
|
| 24 |
-
"rope_interleaved": false,
|
| 25 |
"rope_scaling": null,
|
| 26 |
-
"rope_theta":
|
| 27 |
"tie_word_embeddings": true,
|
| 28 |
-
"torch_dtype": "
|
| 29 |
"transformers.js_config": {
|
|
|
|
| 30 |
"kv_cache_dtype": {
|
| 31 |
"fp16": "float16",
|
| 32 |
"q4f16": "float16"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
}
|
| 34 |
},
|
| 35 |
-
"transformers_version": "4.52.
|
| 36 |
"use_cache": true,
|
| 37 |
"vocab_size": 49152
|
| 38 |
}
|
|
|
|
| 8 |
"eos_token_id": 2,
|
| 9 |
"head_dim": 64,
|
| 10 |
"hidden_act": "silu",
|
| 11 |
+
"hidden_size": 2048,
|
| 12 |
"initializer_range": 0.02,
|
| 13 |
+
"intermediate_size": 8192,
|
|
|
|
| 14 |
"max_position_embeddings": 8192,
|
| 15 |
"mlp_bias": false,
|
| 16 |
"model_type": "llama",
|
| 17 |
+
"num_attention_heads": 32,
|
| 18 |
+
"num_hidden_layers": 24,
|
| 19 |
+
"num_key_value_heads": 32,
|
| 20 |
"pad_token_id": 2,
|
| 21 |
"pretraining_tp": 1,
|
| 22 |
"rms_norm_eps": 1e-05,
|
|
|
|
| 23 |
"rope_scaling": null,
|
| 24 |
+
"rope_theta": 130000,
|
| 25 |
"tie_word_embeddings": true,
|
| 26 |
+
"torch_dtype": "bfloat16",
|
| 27 |
"transformers.js_config": {
|
| 28 |
+
"dtype": "q4",
|
| 29 |
"kv_cache_dtype": {
|
| 30 |
"fp16": "float16",
|
| 31 |
"q4f16": "float16"
|
| 32 |
+
},
|
| 33 |
+
"use_external_data_format": {
|
| 34 |
+
"model.onnx": true,
|
| 35 |
+
"model_fp16.onnx": true
|
| 36 |
}
|
| 37 |
},
|
| 38 |
+
"transformers_version": "4.52.3",
|
| 39 |
"use_cache": true,
|
| 40 |
"vocab_size": 49152
|
| 41 |
}
|
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.52.
|
| 7 |
}
|
|
|
|
| 3 |
"bos_token_id": 1,
|
| 4 |
"eos_token_id": 2,
|
| 5 |
"pad_token_id": 2,
|
| 6 |
+
"transformers_version": "4.52.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:aa466c251540e26d17d239de3cb2fe5a5f3384c8a43b893ee30c3d0500caabd5
|
| 3 |
+
size 3422777952
|