Instructions to use h-tonywu/qwen3.5-moe-debug with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use h-tonywu/qwen3.5-moe-debug with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="h-tonywu/qwen3.5-moe-debug") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("h-tonywu/qwen3.5-moe-debug") model = AutoModelForMultimodalLM.from_pretrained("h-tonywu/qwen3.5-moe-debug", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use h-tonywu/qwen3.5-moe-debug with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "h-tonywu/qwen3.5-moe-debug" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "h-tonywu/qwen3.5-moe-debug", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/h-tonywu/qwen3.5-moe-debug
- SGLang
How to use h-tonywu/qwen3.5-moe-debug 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 "h-tonywu/qwen3.5-moe-debug" \ --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": "h-tonywu/qwen3.5-moe-debug", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "h-tonywu/qwen3.5-moe-debug" \ --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": "h-tonywu/qwen3.5-moe-debug", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use h-tonywu/qwen3.5-moe-debug with Docker Model Runner:
docker model run hf.co/h-tonywu/qwen3.5-moe-debug
Update README.md
Browse files
README.md
CHANGED
|
@@ -92,6 +92,54 @@ output_text = processor.batch_decode(generated_ids[0][inputs['input_ids'].shape[
|
|
| 92 |
print(output_text)
|
| 93 |
```
|
| 94 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
### Codes to create this repo:
|
| 96 |
|
| 97 |
<details>
|
|
|
|
| 92 |
print(output_text)
|
| 93 |
```
|
| 94 |
|
| 95 |
+
### Comparison
|
| 96 |
+
|
| 97 |
+
| Field | Qwen/Qwen3.5-397B-A17B | h-tonywu/qwen3.5-moe-debug |
|
| 98 |
+
| -------------------- | ---------------------- | -------------------------- |
|
| 99 |
+
| transformers_version | 4.57.0.dev0 | 5.2.0.dev0 |
|
| 100 |
+
| top-level `dtype` | — | bfloat16 |
|
| 101 |
+
|
| 102 |
+
#### Text model
|
| 103 |
+
|
| 104 |
+
| Field | 397B | Debug |
|
| 105 |
+
| ------------------------------- | ------------ | --------- |
|
| 106 |
+
| hidden_size | 4096 | 8 |
|
| 107 |
+
| head_dim | 256 | 32 |
|
| 108 |
+
| num_hidden_layers | 60 | 4 |
|
| 109 |
+
| num_attention_heads | 32 | 8 |
|
| 110 |
+
| num_key_value_heads | 2 | 4 |
|
| 111 |
+
| num_experts | 512 | 128 |
|
| 112 |
+
| num_experts_per_tok | 10 | 10 |
|
| 113 |
+
| moe_intermediate_size | 1024 | 32 |
|
| 114 |
+
| shared_expert_intermediate_size | 1024 | 32 |
|
| 115 |
+
| intermediate_size | — | 32 |
|
| 116 |
+
| linear_key_head_dim | 128 | 32 |
|
| 117 |
+
| linear_value_head_dim | 128 | 32 |
|
| 118 |
+
| linear_num_key_heads | 16 | 4 |
|
| 119 |
+
| linear_num_value_heads | 64 | 8 |
|
| 120 |
+
| layer_types length | 60 | 4 |
|
| 121 |
+
| rope_parameters.mrope_section | [11, 11, 10] | [1, 1, 2] |
|
| 122 |
+
|
| 123 |
+
#### Text config fields only in debug
|
| 124 |
+
|
| 125 |
+
| Field | Value |
|
| 126 |
+
| ------------------------------------------------ | ----- |
|
| 127 |
+
| bos_token_id | null |
|
| 128 |
+
| pad_token_id | null |
|
| 129 |
+
| output_router_logits | false |
|
| 130 |
+
| text_config.tie_word_embeddings | false |
|
| 131 |
+
| partial_rotary_factor (top-level in text_config) | 0.25 |
|
| 132 |
+
|
| 133 |
+
#### Vision model
|
| 134 |
+
|
| 135 |
+
| Field | 397B | Debug |
|
| 136 |
+
| ----------------- | ---- | ----- |
|
| 137 |
+
| depth | 27 | 2 |
|
| 138 |
+
| hidden_size | 1152 | 64 |
|
| 139 |
+
| intermediate_size | 4304 | 128 |
|
| 140 |
+
| num_heads | 16 | 2 |
|
| 141 |
+
| out_hidden_size | 4096 | 8 |
|
| 142 |
+
|
| 143 |
### Codes to create this repo:
|
| 144 |
|
| 145 |
<details>
|