Instructions to use SmallDoge/Doge-320M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SmallDoge/Doge-320M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SmallDoge/Doge-320M", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SmallDoge/Doge-320M", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("SmallDoge/Doge-320M", trust_remote_code=True) 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-320M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SmallDoge/Doge-320M" # 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-320M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SmallDoge/Doge-320M
- SGLang
How to use SmallDoge/Doge-320M 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-320M" \ --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-320M", "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-320M" \ --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-320M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use SmallDoge/Doge-320M with Docker Model Runner:
docker model run hf.co/SmallDoge/Doge-320M
Upload DogeForCausalLM
Browse files- config.json +6 -6
- model.safetensors +2 -2
config.json
CHANGED
|
@@ -11,27 +11,27 @@
|
|
| 11 |
"bos_token_id": 0,
|
| 12 |
"dynamic_mask_ratio": 0.0,
|
| 13 |
"eos_token_id": 1,
|
| 14 |
-
"expert_retrieval_size":
|
| 15 |
"hidden_act": "silu",
|
| 16 |
"hidden_bias": false,
|
| 17 |
"hidden_dropout": 0.0,
|
| 18 |
-
"hidden_size":
|
| 19 |
"initializer_range": 0.02,
|
| 20 |
-
"intermediate_size":
|
| 21 |
"is_moe": false,
|
| 22 |
"keep_window_size": 2048,
|
| 23 |
"max_position_embeddings": 2048,
|
| 24 |
"mlp_bias": false,
|
| 25 |
"model_type": "doge",
|
| 26 |
"norm_topk_prob": false,
|
| 27 |
-
"num_attention_heads":
|
| 28 |
"num_cdmoe_experts": 16348,
|
| 29 |
"num_cdmoe_experts_per_head": 8,
|
| 30 |
"num_cdmoe_heads": 4,
|
| 31 |
"num_experts": 16384,
|
| 32 |
"num_experts_per_tok": 64,
|
| 33 |
-
"num_hidden_layers":
|
| 34 |
-
"num_key_value_heads":
|
| 35 |
"output_router_logits": false,
|
| 36 |
"pad_token_id": 2,
|
| 37 |
"rms_norm_eps": 1e-06,
|
|
|
|
| 11 |
"bos_token_id": 0,
|
| 12 |
"dynamic_mask_ratio": 0.0,
|
| 13 |
"eos_token_id": 1,
|
| 14 |
+
"expert_retrieval_size": 64,
|
| 15 |
"hidden_act": "silu",
|
| 16 |
"hidden_bias": false,
|
| 17 |
"hidden_dropout": 0.0,
|
| 18 |
+
"hidden_size": 768,
|
| 19 |
"initializer_range": 0.02,
|
| 20 |
+
"intermediate_size": 1536,
|
| 21 |
"is_moe": false,
|
| 22 |
"keep_window_size": 2048,
|
| 23 |
"max_position_embeddings": 2048,
|
| 24 |
"mlp_bias": false,
|
| 25 |
"model_type": "doge",
|
| 26 |
"norm_topk_prob": false,
|
| 27 |
+
"num_attention_heads": 6,
|
| 28 |
"num_cdmoe_experts": 16348,
|
| 29 |
"num_cdmoe_experts_per_head": 8,
|
| 30 |
"num_cdmoe_heads": 4,
|
| 31 |
"num_experts": 16384,
|
| 32 |
"num_experts_per_tok": 64,
|
| 33 |
+
"num_hidden_layers": 24,
|
| 34 |
+
"num_key_value_heads": 3,
|
| 35 |
"output_router_logits": false,
|
| 36 |
"pad_token_id": 2,
|
| 37 |
"rms_norm_eps": 1e-06,
|
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:c8ce781a449231f7744179cffa570d5f4e727f7867476b6810b9e8c8c5e80530
|
| 3 |
+
size 305429944
|