Instructions to use SJTU-DENG-Lab/MBD-Code-LLaDA2-mini-16B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SJTU-DENG-Lab/MBD-Code-LLaDA2-mini-16B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SJTU-DENG-Lab/MBD-Code-LLaDA2-mini-16B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("SJTU-DENG-Lab/MBD-Code-LLaDA2-mini-16B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SJTU-DENG-Lab/MBD-Code-LLaDA2-mini-16B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SJTU-DENG-Lab/MBD-Code-LLaDA2-mini-16B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SJTU-DENG-Lab/MBD-Code-LLaDA2-mini-16B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SJTU-DENG-Lab/MBD-Code-LLaDA2-mini-16B
- SGLang
How to use SJTU-DENG-Lab/MBD-Code-LLaDA2-mini-16B 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 "SJTU-DENG-Lab/MBD-Code-LLaDA2-mini-16B" \ --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": "SJTU-DENG-Lab/MBD-Code-LLaDA2-mini-16B", "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 "SJTU-DENG-Lab/MBD-Code-LLaDA2-mini-16B" \ --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": "SJTU-DENG-Lab/MBD-Code-LLaDA2-mini-16B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use SJTU-DENG-Lab/MBD-Code-LLaDA2-mini-16B with Docker Model Runner:
docker model run hf.co/SJTU-DENG-Lab/MBD-Code-LLaDA2-mini-16B
Upload config.json
Browse files- config.json +57 -0
config.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_moe_implementation": "fused",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"LLaDA2MoeModelLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"auto_map": {
|
| 8 |
+
"AutoConfig": "configuration_llada2_moe.LLaDA2MoeConfig",
|
| 9 |
+
"AutoModel": "modeling_llada2_moe.LLaDA2MoeModel",
|
| 10 |
+
"AutoModelForCausalLM": "modeling_llada2_moe.LLaDA2MoeModelLM"
|
| 11 |
+
},
|
| 12 |
+
"dtype": "bfloat16",
|
| 13 |
+
"embedding_dropout": 0.0,
|
| 14 |
+
"first_k_dense_replace": 1,
|
| 15 |
+
"head_dim": 128,
|
| 16 |
+
"hidden_act": "silu",
|
| 17 |
+
"hidden_size": 2048,
|
| 18 |
+
"initializer_range": 0.02,
|
| 19 |
+
"intermediate_size": 5120,
|
| 20 |
+
"max_position_embeddings": 16384,
|
| 21 |
+
"max_window_layers": 28,
|
| 22 |
+
"model_type": "llada2_moe",
|
| 23 |
+
"moe_intermediate_size": 512,
|
| 24 |
+
"moe_router_enable_expert_bias": true,
|
| 25 |
+
"n_group": 8,
|
| 26 |
+
"norm_head": false,
|
| 27 |
+
"norm_softmax": false,
|
| 28 |
+
"norm_topk_prob": true,
|
| 29 |
+
"num_attention_heads": 16,
|
| 30 |
+
"num_experts": 256,
|
| 31 |
+
"num_experts_per_tok": 8,
|
| 32 |
+
"num_hidden_layers": 20,
|
| 33 |
+
"num_key_value_heads": 4,
|
| 34 |
+
"num_shared_experts": 1,
|
| 35 |
+
"output_dropout": 0.0,
|
| 36 |
+
"output_router_logits": false,
|
| 37 |
+
"pad_token_id": 156892,
|
| 38 |
+
"partial_rotary_factor": 0.5,
|
| 39 |
+
"rms_norm_eps": 1e-06,
|
| 40 |
+
"rope_scaling": null,
|
| 41 |
+
"rope_theta": 600000,
|
| 42 |
+
"rotary_dim": 64,
|
| 43 |
+
"routed_scaling_factor": 2.5,
|
| 44 |
+
"router_dtype": "fp32",
|
| 45 |
+
"score_function": "sigmoid",
|
| 46 |
+
"sliding_window": 4096,
|
| 47 |
+
"tie_word_embeddings": false,
|
| 48 |
+
"topk_group": 4,
|
| 49 |
+
"transformers_version": "4.57.3",
|
| 50 |
+
"use_bias": false,
|
| 51 |
+
"use_cache": false,
|
| 52 |
+
"use_qkv_bias": false,
|
| 53 |
+
"use_rmsnorm": true,
|
| 54 |
+
"use_sliding_window": false,
|
| 55 |
+
"using_split_qkv_in_self_attention": false,
|
| 56 |
+
"vocab_size": 157184
|
| 57 |
+
}
|