Instructions to use SmallDoge/Doge-20M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SmallDoge/Doge-20M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SmallDoge/Doge-20M") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SmallDoge/Doge-20M") model = AutoModelForCausalLM.from_pretrained("SmallDoge/Doge-20M") 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 SmallDoge/Doge-20M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SmallDoge/Doge-20M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SmallDoge/Doge-20M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SmallDoge/Doge-20M
- SGLang
How to use SmallDoge/Doge-20M 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 "SmallDoge/Doge-20M" \ --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": "SmallDoge/Doge-20M", "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 "SmallDoge/Doge-20M" \ --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": "SmallDoge/Doge-20M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use SmallDoge/Doge-20M with Docker Model Runner:
docker model run hf.co/SmallDoge/Doge-20M
Upload tokenizer
Browse files- tokenizer.json +8 -8
- tokenizer_config.json +8 -8
tokenizer.json
CHANGED
|
@@ -2272,8 +2272,8 @@
|
|
| 2272 |
"special": true
|
| 2273 |
},
|
| 2274 |
{
|
| 2275 |
-
"id":
|
| 2276 |
-
"content": "<
|
| 2277 |
"single_word": false,
|
| 2278 |
"lstrip": false,
|
| 2279 |
"rstrip": false,
|
|
@@ -2281,8 +2281,8 @@
|
|
| 2281 |
"special": true
|
| 2282 |
},
|
| 2283 |
{
|
| 2284 |
-
"id":
|
| 2285 |
-
"content": "<
|
| 2286 |
"single_word": false,
|
| 2287 |
"lstrip": false,
|
| 2288 |
"rstrip": false,
|
|
@@ -2290,8 +2290,8 @@
|
|
| 2290 |
"special": true
|
| 2291 |
},
|
| 2292 |
{
|
| 2293 |
-
"id":
|
| 2294 |
-
"content": "<
|
| 2295 |
"single_word": false,
|
| 2296 |
"lstrip": false,
|
| 2297 |
"rstrip": false,
|
|
@@ -2299,8 +2299,8 @@
|
|
| 2299 |
"special": true
|
| 2300 |
},
|
| 2301 |
{
|
| 2302 |
-
"id":
|
| 2303 |
-
"content": "<
|
| 2304 |
"single_word": false,
|
| 2305 |
"lstrip": false,
|
| 2306 |
"rstrip": false,
|
|
|
|
| 2272 |
"special": true
|
| 2273 |
},
|
| 2274 |
{
|
| 2275 |
+
"id": 32768,
|
| 2276 |
+
"content": "<think>",
|
| 2277 |
"single_word": false,
|
| 2278 |
"lstrip": false,
|
| 2279 |
"rstrip": false,
|
|
|
|
| 2281 |
"special": true
|
| 2282 |
},
|
| 2283 |
{
|
| 2284 |
+
"id": 32769,
|
| 2285 |
+
"content": "</think>",
|
| 2286 |
"single_word": false,
|
| 2287 |
"lstrip": false,
|
| 2288 |
"rstrip": false,
|
|
|
|
| 2290 |
"special": true
|
| 2291 |
},
|
| 2292 |
{
|
| 2293 |
+
"id": 32770,
|
| 2294 |
+
"content": "<answer>",
|
| 2295 |
"single_word": false,
|
| 2296 |
"lstrip": false,
|
| 2297 |
"rstrip": false,
|
|
|
|
| 2299 |
"special": true
|
| 2300 |
},
|
| 2301 |
{
|
| 2302 |
+
"id": 32771,
|
| 2303 |
+
"content": "</answer>",
|
| 2304 |
"single_word": false,
|
| 2305 |
"lstrip": false,
|
| 2306 |
"rstrip": false,
|
tokenizer_config.json
CHANGED
|
@@ -2016,32 +2016,32 @@
|
|
| 2016 |
"single_word": false,
|
| 2017 |
"special": true
|
| 2018 |
},
|
| 2019 |
-
"
|
| 2020 |
-
"content": "<
|
| 2021 |
"lstrip": false,
|
| 2022 |
"normalized": false,
|
| 2023 |
"rstrip": false,
|
| 2024 |
"single_word": false,
|
| 2025 |
"special": true
|
| 2026 |
},
|
| 2027 |
-
"
|
| 2028 |
-
"content": "<
|
| 2029 |
"lstrip": false,
|
| 2030 |
"normalized": false,
|
| 2031 |
"rstrip": false,
|
| 2032 |
"single_word": false,
|
| 2033 |
"special": true
|
| 2034 |
},
|
| 2035 |
-
"
|
| 2036 |
-
"content": "<
|
| 2037 |
"lstrip": false,
|
| 2038 |
"normalized": false,
|
| 2039 |
"rstrip": false,
|
| 2040 |
"single_word": false,
|
| 2041 |
"special": true
|
| 2042 |
},
|
| 2043 |
-
"
|
| 2044 |
-
"content": "<
|
| 2045 |
"lstrip": false,
|
| 2046 |
"normalized": false,
|
| 2047 |
"rstrip": false,
|
|
|
|
| 2016 |
"single_word": false,
|
| 2017 |
"special": true
|
| 2018 |
},
|
| 2019 |
+
"32768": {
|
| 2020 |
+
"content": "<think>",
|
| 2021 |
"lstrip": false,
|
| 2022 |
"normalized": false,
|
| 2023 |
"rstrip": false,
|
| 2024 |
"single_word": false,
|
| 2025 |
"special": true
|
| 2026 |
},
|
| 2027 |
+
"32769": {
|
| 2028 |
+
"content": "</think>",
|
| 2029 |
"lstrip": false,
|
| 2030 |
"normalized": false,
|
| 2031 |
"rstrip": false,
|
| 2032 |
"single_word": false,
|
| 2033 |
"special": true
|
| 2034 |
},
|
| 2035 |
+
"32770": {
|
| 2036 |
+
"content": "<answer>",
|
| 2037 |
"lstrip": false,
|
| 2038 |
"normalized": false,
|
| 2039 |
"rstrip": false,
|
| 2040 |
"single_word": false,
|
| 2041 |
"special": true
|
| 2042 |
},
|
| 2043 |
+
"32771": {
|
| 2044 |
+
"content": "</answer>",
|
| 2045 |
"lstrip": false,
|
| 2046 |
"normalized": false,
|
| 2047 |
"rstrip": false,
|