Text Generation
MLX
Safetensors
qwen3_5_moe
mlx-lm
qwen3.6
Mixture of Experts
modelopt
quantized
nvfp4
fp4
fp8
lora
merged
antidoom
conversational
Instructions to use mlx-community/Qwen3.6-35B-A3B-AntiLoop-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/Qwen3.6-35B-A3B-AntiLoop-NVFP4 with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("mlx-community/Qwen3.6-35B-A3B-AntiLoop-NVFP4") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use mlx-community/Qwen3.6-35B-A3B-AntiLoop-NVFP4 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mlx-community/Qwen3.6-35B-A3B-AntiLoop-NVFP4"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "mlx-community/Qwen3.6-35B-A3B-AntiLoop-NVFP4" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use mlx-community/Qwen3.6-35B-A3B-AntiLoop-NVFP4 with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "mlx-community/Qwen3.6-35B-A3B-AntiLoop-NVFP4"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "mlx-community/Qwen3.6-35B-A3B-AntiLoop-NVFP4" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlx-community/Qwen3.6-35B-A3B-AntiLoop-NVFP4", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use mlx-community/Qwen3.6-35B-A3B-AntiLoop-NVFP4 with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mlx-community/Qwen3.6-35B-A3B-AntiLoop-NVFP4"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default mlx-community/Qwen3.6-35B-A3B-AntiLoop-NVFP4
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use mlx-community/Qwen3.6-35B-A3B-AntiLoop-NVFP4 with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mlx-community/Qwen3.6-35B-A3B-AntiLoop-NVFP4"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "mlx-community/Qwen3.6-35B-A3B-AntiLoop-NVFP4" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Ship lossless text-only MLX-LM package
Browse filesRemove the vision tower and mlx-vlm runtime. Preserve all 41 mixed FP8/NVFP4 language shards exactly, use the model-local MLX-LM kernels, and document the zero-requantization representation and text-only runtime.
- README.md +52 -65
- __pycache__/modeling_mlx_qwen36_modelopt_hybrid.cpython-311.pyc +0 -0
- config.json +1 -29
- generation_config.json +1 -1
- mlx_conversion_manifest.json +6 -9
- mlx_vlm_model_file_loader.py +0 -121
- model-vision.safetensors +0 -3
- model.safetensors.index.json +2 -335
- modeling_mlx_vlm_qwen36_modelopt_hybrid.py +0 -217
- preprocessor_config.json +0 -21
- run_mlx_vlm.py +0 -12
- run_mlx_vlm_server.py +0 -12
- video_preprocessor_config.json +0 -21
README.md
CHANGED
|
@@ -5,11 +5,10 @@ license_link: https://huggingface.co/Qwen/Qwen3.6-35B-A3B/blob/995ad96eacd98c81e
|
|
| 5 |
base_model:
|
| 6 |
- nvidia/Qwen3.6-35B-A3B-NVFP4
|
| 7 |
- N8Programs/Qwen3.6-35B-A3B-AntiLoop
|
| 8 |
-
pipeline_tag:
|
| 9 |
tags:
|
| 10 |
- mlx
|
| 11 |
-
- mlx-
|
| 12 |
-
- image-text-to-text
|
| 13 |
- qwen3.6
|
| 14 |
- moe
|
| 15 |
- modelopt
|
|
@@ -22,86 +21,72 @@ tags:
|
|
| 22 |
- antidoom
|
| 23 |
---
|
| 24 |
|
| 25 |
-
# Qwen3.6-35B-A3B-AntiLoop-NVFP4 for MLX-
|
| 26 |
|
| 27 |

|
| 28 |
|
| 29 |

|
| 30 |
|
| 31 |
-
This is the
|
| 32 |
[`N8Programs/Qwen3.6-35B-A3B-AntiLoop-NVFP4`](https://huggingface.co/N8Programs/Qwen3.6-35B-A3B-AntiLoop-NVFP4).
|
| 33 |
-
It
|
|
|
|
|
|
|
| 34 |
|
| 35 |
-
|
| 36 |
-
checkpoint. Its FP8 and NVFP4 payloads and scales are re-expressed for MLX's
|
| 37 |
-
native MXFP8/NVFP4 kernels, while the source tensor-level scales are applied by
|
| 38 |
-
the included runtime. Activations remain in the model dtype. The vision tower
|
| 39 |
-
is the original BF16 data, byte-for-byte rather than quantized.
|
| 40 |
|
| 41 |
-
|
| 42 |
-
- 130 scaled MXFP8 dense modules
|
| 43 |
-
- 121 scaled NVFP4 dense modules
|
| 44 |
-
- 120 scaled NVFP4 expert projections
|
| 45 |
-
- 333 BF16 vision tensors (893,142,496 tensor-data bytes)
|
| 46 |
|
| 47 |
-
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
-
|
| 55 |
-
pip install -U "mlx-vlm==0.6.4"
|
| 56 |
-
hf download mlx-community/Qwen3.6-35B-A3B-AntiLoop-NVFP4 \
|
| 57 |
-
--local-dir Qwen3.6-35B-A3B-AntiLoop-NVFP4
|
| 58 |
-
cd Qwen3.6-35B-A3B-AntiLoop-NVFP4
|
| 59 |
-
```
|
| 60 |
|
| 61 |
-
|
| 62 |
|
| 63 |
```bash
|
| 64 |
-
|
| 65 |
-
--model . \
|
| 66 |
-
--trust-remote-code \
|
| 67 |
-
--image /path/to/image.png \
|
| 68 |
-
--prompt "Describe this image." \
|
| 69 |
-
--max-tokens 256
|
| 70 |
```
|
| 71 |
|
| 72 |
-
|
| 73 |
|
| 74 |
```bash
|
| 75 |
-
python
|
| 76 |
-
--model . \
|
| 77 |
--trust-remote-code \
|
| 78 |
-
--enable-thinking \
|
| 79 |
--prompt "Solve: 27 * 43" \
|
| 80 |
--max-tokens 512
|
| 81 |
```
|
| 82 |
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
from mlx_vlm_model_file_loader import load
|
| 87 |
-
|
| 88 |
-
model, processor = load(".")
|
| 89 |
-
```
|
| 90 |
-
|
| 91 |
-
MLX-VLM 0.6.4 does not yet natively consult a model-local
|
| 92 |
-
`vlm_model_file`. `run_mlx_vlm.py` installs that single lookup inside the
|
| 93 |
-
current process without modifying the installed package. The local runtime is
|
| 94 |
-
executed only when `--trust-remote-code` (or `trust_remote_code=True`) is
|
| 95 |
-
explicitly enabled. Review the included Python files before trusting them.
|
| 96 |
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
--model . \
|
| 102 |
-
--trust-remote-code \
|
| 103 |
-
--enable-thinking
|
| 104 |
-
```
|
| 105 |
|
| 106 |
## Original model card
|
| 107 |
|
|
@@ -110,10 +95,10 @@ This is a mixed-precision NVIDIA ModelOpt deployment checkpoint for
|
|
| 110 |
a narrow fine-tune intended to recover from pathological self-verification and
|
| 111 |
enumeration loops while preserving ordinary long-form reasoning.
|
| 112 |
|
| 113 |
-
No PEFT adapter is required at inference time.
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
|
| 118 |
## Training data
|
| 119 |
|
|
@@ -250,17 +235,19 @@ limitations.
|
|
| 250 |
## Limitations
|
| 251 |
|
| 252 |
- This is a narrow behavioral fine-tune, not a general alignment or safety model.
|
| 253 |
-
-
|
|
|
|
|
|
|
| 254 |
- LoopHard is a task-specific, judge-based benchmark; its loop rate should not
|
| 255 |
be interpreted as a general safety, truthfulness, or factuality score.
|
| 256 |
- The GPQA and GSM8K checks used runtime LoRA on an FP8 base, not this exact
|
| 257 |
mixed-precision artifact.
|
| 258 |
- Capability preservation has not been tested at `presence_penalty=1.5`.
|
| 259 |
-
-
|
| 260 |
-
adapter updates can round away or clip at the original E4M3
|
|
|
|
| 261 |
- Runtime validation used a 65,536-token configured context, not the full native
|
| 262 |
262,144-token context.
|
| 263 |
-
- Multimodal generation quality has not been evaluated on this artifact.
|
| 264 |
- Outputs may still be incorrect, overconfident, repetitive, biased, toxic, or
|
| 265 |
unsafe.
|
| 266 |
|
|
|
|
| 5 |
base_model:
|
| 6 |
- nvidia/Qwen3.6-35B-A3B-NVFP4
|
| 7 |
- N8Programs/Qwen3.6-35B-A3B-AntiLoop
|
| 8 |
+
pipeline_tag: text-generation
|
| 9 |
tags:
|
| 10 |
- mlx
|
| 11 |
+
- mlx-lm
|
|
|
|
| 12 |
- qwen3.6
|
| 13 |
- moe
|
| 14 |
- modelopt
|
|
|
|
| 21 |
- antidoom
|
| 22 |
---
|
| 23 |
|
| 24 |
+
# Qwen3.6-35B-A3B-AntiLoop-NVFP4 for MLX-LM
|
| 25 |
|
| 26 |

|
| 27 |
|
| 28 |

|
| 29 |
|
| 30 |
+
This is the **text-only, lossless-weight MLX-LM conversion** of
|
| 31 |
[`N8Programs/Qwen3.6-35B-A3B-AntiLoop-NVFP4`](https://huggingface.co/N8Programs/Qwen3.6-35B-A3B-AntiLoop-NVFP4).
|
| 32 |
+
It deliberately omits the vision tower so the mixed NVIDIA ModelOpt weights
|
| 33 |
+
can be preserved without a second quantization pass or an installed-package
|
| 34 |
+
patch.
|
| 35 |
|
| 36 |
+
## Lossless MLX representation
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
+
All source quantized weight payloads and scales are retained:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
+
- ModelOpt FP8 E4M3 bytes are packed directly into MLX `uint32` tensors with
|
| 41 |
+
unit E8M0 carrier scales; the original FP32 tensor scale is applied after
|
| 42 |
+
MLX's native MXFP8 matrix multiplication.
|
| 43 |
+
- ModelOpt NVFP4 E2M1 nibbles and E4M3 block-scale bytes remain bit-identical;
|
| 44 |
+
the original FP32 tensor or per-expert scale is applied after MLX's native
|
| 45 |
+
NVFP4 matrix multiplication.
|
| 46 |
+
- BF16 and FP32 language-model tensors remain in their source precision.
|
| 47 |
+
- No weight tensor is dequantized or requantized during conversion.
|
| 48 |
|
| 49 |
+
The package contains 1,475 tensors across 41 language shards: 130 scaled MXFP8
|
| 50 |
+
dense modules, 121 scaled NVFP4 dense modules, and 120 scaled NVFP4 expert
|
| 51 |
+
projections. `weight_bytes_requantized=false` is recorded in
|
| 52 |
+
`mlx_conversion_manifest.json`.
|
| 53 |
|
| 54 |
+
“Lossless” here means no additional error is introduced into the source
|
| 55 |
+
quantized **weights**. Activations remain in the model dtype instead of using
|
| 56 |
+
the source checkpoint's stored activation scales, so execution is not expected
|
| 57 |
+
to be bit-identical to NVIDIA ModelOpt inference.
|
| 58 |
|
| 59 |
+
## Use with MLX-LM
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
+
Install the tested runtime:
|
| 62 |
|
| 63 |
```bash
|
| 64 |
+
pip install -U "mlx-lm==0.31.3"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
```
|
| 66 |
|
| 67 |
+
Generate with an unmodified MLX-LM installation:
|
| 68 |
|
| 69 |
```bash
|
| 70 |
+
python -m mlx_lm generate \
|
| 71 |
+
--model mlx-community/Qwen3.6-35B-A3B-AntiLoop-NVFP4 \
|
| 72 |
--trust-remote-code \
|
|
|
|
| 73 |
--prompt "Solve: 27 * 43" \
|
| 74 |
--max-tokens 512
|
| 75 |
```
|
| 76 |
|
| 77 |
+
The packaged interactive defaults are `temperature=0.6`, `top_p=0.95`, and
|
| 78 |
+
`top_k=20`. The Qwen chat template retains its `enable_thinking` control, so
|
| 79 |
+
clients such as LM Studio can expose the usual thinking toggle.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
+
MLX-LM natively loads the included
|
| 82 |
+
`modeling_mlx_qwen36_modelopt_hybrid.py` through its model-local `model_file`
|
| 83 |
+
architecture hook; the loader does not patch or modify the installed package.
|
| 84 |
+
Review that runtime file before loading this repository. In MLX-LM 0.31.3,
|
| 85 |
+
`--trust-remote-code` controls tokenizer loading rather than the `model_file`
|
| 86 |
+
hook; it is included above for tokenizer compatibility.
|
| 87 |
|
| 88 |
+
This repository is intentionally text-only. It does not contain the 333 BF16
|
| 89 |
+
vision tensors, image processor, or video processor from the upstream model.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
|
| 91 |
## Original model card
|
| 92 |
|
|
|
|
| 95 |
a narrow fine-tune intended to recover from pathological self-verification and
|
| 96 |
enumeration loops while preserving ordinary long-form reasoning.
|
| 97 |
|
| 98 |
+
No PEFT adapter is required at inference time. This MLX-LM derivative retains
|
| 99 |
+
the language architecture, tokenizer, chat template, and 262,144-token native
|
| 100 |
+
context configuration. It does not package the vision tower or MTP draft
|
| 101 |
+
weights.
|
| 102 |
|
| 103 |
## Training data
|
| 104 |
|
|
|
|
| 235 |
## Limitations
|
| 236 |
|
| 237 |
- This is a narrow behavioral fine-tune, not a general alignment or safety model.
|
| 238 |
+
- This MLX-LM artifact is text-only; image and video inputs are unsupported.
|
| 239 |
+
- The conversion preserves quantized weight values, but uses model-dtype
|
| 240 |
+
activations rather than the source ModelOpt activation scales.
|
| 241 |
- LoopHard is a task-specific, judge-based benchmark; its loop rate should not
|
| 242 |
be interpreted as a general safety, truthfulness, or factuality score.
|
| 243 |
- The GPQA and GSM8K checks used runtime LoRA on an FP8 base, not this exact
|
| 244 |
mixed-precision artifact.
|
| 245 |
- Capability preservation has not been tested at `presence_penalty=1.5`.
|
| 246 |
+
- The source checkpoint's fixed-scale FP8 merge approximates the exact BF16
|
| 247 |
+
LoRA merge; small adapter updates can round away or clip at the original E4M3
|
| 248 |
+
range. This MLX conversion does not add another weight-quantization pass.
|
| 249 |
- Runtime validation used a 65,536-token configured context, not the full native
|
| 250 |
262,144-token context.
|
|
|
|
| 251 |
- Outputs may still be incorrect, overconfident, repetitive, biased, toxic, or
|
| 252 |
unsafe.
|
| 253 |
|
__pycache__/modeling_mlx_qwen36_modelopt_hybrid.cpython-311.pyc
ADDED
|
Binary file (11.5 kB). View file
|
|
|
config.json
CHANGED
|
@@ -3,7 +3,6 @@
|
|
| 3 |
"Qwen3_5MoeForConditionalGeneration"
|
| 4 |
],
|
| 5 |
"dtype": "bfloat16",
|
| 6 |
-
"image_token_id": 248056,
|
| 7 |
"mlx_hybrid_format": {
|
| 8 |
"activations": "model_dtype_weight_only_quantized_matmul",
|
| 9 |
"format": "modelopt_fp8_nvfp4_v1",
|
|
@@ -1380,12 +1379,6 @@
|
|
| 1380 |
"quant_algo": "W4A16_NVFP4"
|
| 1381 |
}
|
| 1382 |
}
|
| 1383 |
-
},
|
| 1384 |
-
"vision": {
|
| 1385 |
-
"storage": "bf16_exact_source_weights",
|
| 1386 |
-
"tensor_count": 333,
|
| 1387 |
-
"tensor_data_bytes": 893142496,
|
| 1388 |
-
"weight_bytes_requantized": false
|
| 1389 |
}
|
| 1390 |
},
|
| 1391 |
"mlx_modelopt_quantization": {
|
|
@@ -1855,26 +1848,5 @@
|
|
| 1855 |
"vocab_size": 248320
|
| 1856 |
},
|
| 1857 |
"tie_word_embeddings": false,
|
| 1858 |
-
"transformers_version": "5.7.0.dev0"
|
| 1859 |
-
"video_token_id": 248057,
|
| 1860 |
-
"vision_config": {
|
| 1861 |
-
"deepstack_visual_indexes": [],
|
| 1862 |
-
"depth": 27,
|
| 1863 |
-
"dtype": "bfloat16",
|
| 1864 |
-
"hidden_act": "gelu_pytorch_tanh",
|
| 1865 |
-
"hidden_size": 1152,
|
| 1866 |
-
"in_channels": 3,
|
| 1867 |
-
"initializer_range": 0.02,
|
| 1868 |
-
"intermediate_size": 4304,
|
| 1869 |
-
"model_type": "qwen3_5_moe_vision",
|
| 1870 |
-
"num_heads": 16,
|
| 1871 |
-
"num_position_embeddings": 2304,
|
| 1872 |
-
"out_hidden_size": 2048,
|
| 1873 |
-
"patch_size": 16,
|
| 1874 |
-
"spatial_merge_size": 2,
|
| 1875 |
-
"temporal_patch_size": 2
|
| 1876 |
-
},
|
| 1877 |
-
"vision_end_token_id": 248054,
|
| 1878 |
-
"vision_start_token_id": 248053,
|
| 1879 |
-
"vlm_model_file": "modeling_mlx_vlm_qwen36_modelopt_hybrid.py"
|
| 1880 |
}
|
|
|
|
| 3 |
"Qwen3_5MoeForConditionalGeneration"
|
| 4 |
],
|
| 5 |
"dtype": "bfloat16",
|
|
|
|
| 6 |
"mlx_hybrid_format": {
|
| 7 |
"activations": "model_dtype_weight_only_quantized_matmul",
|
| 8 |
"format": "modelopt_fp8_nvfp4_v1",
|
|
|
|
| 1379 |
"quant_algo": "W4A16_NVFP4"
|
| 1380 |
}
|
| 1381 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1382 |
}
|
| 1383 |
},
|
| 1384 |
"mlx_modelopt_quantization": {
|
|
|
|
| 1848 |
"vocab_size": 248320
|
| 1849 |
},
|
| 1850 |
"tie_word_embeddings": false,
|
| 1851 |
+
"transformers_version": "5.7.0.dev0"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1852 |
}
|
generation_config.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
| 6 |
248044
|
| 7 |
],
|
| 8 |
"pad_token_id": 248044,
|
| 9 |
-
|
| 10 |
"top_k": 20,
|
| 11 |
"top_p": 0.95
|
| 12 |
}
|
|
|
|
| 6 |
248044
|
| 7 |
],
|
| 8 |
"pad_token_id": 248044,
|
| 9 |
+
"temperature": 0.6,
|
| 10 |
"top_k": 20,
|
| 11 |
"top_p": 0.95
|
| 12 |
}
|
mlx_conversion_manifest.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
| 1 |
{
|
| 2 |
"converter": "convert_qwen36_modelopt_hybrid_to_mlx.py",
|
|
|
|
| 3 |
"created_at": "2026-07-10T03:37:44.758817+00:00",
|
| 4 |
"input_scales_dropped": 30971,
|
| 5 |
-
"multimodal_upgrade_at": "2026-07-10T04:02:39.296349+00:00",
|
| 6 |
"norm_weights_shifted": true,
|
| 7 |
"num_experts": 256,
|
| 8 |
"num_layers": 40,
|
| 9 |
"output": "mlx-community/Qwen3.6-35B-A3B-AntiLoop-NVFP4",
|
| 10 |
-
"output_shards":
|
| 11 |
-
"output_tensor_count":
|
| 12 |
-
"output_total_size_bytes":
|
| 13 |
"quantized_module_counts": {
|
| 14 |
"scaled_mxfp8": 130,
|
| 15 |
"scaled_nvfp4": 121,
|
|
@@ -18,10 +18,7 @@
|
|
| 18 |
"runtime_file": "modeling_mlx_qwen36_modelopt_hybrid.py",
|
| 19 |
"source": "N8Programs/Qwen3.6-35B-A3B-AntiLoop-NVFP4@1fc377564024dce4e8e7f2bdc04d34cd869f928f",
|
| 20 |
"source_tensor_count": 124468,
|
| 21 |
-
"
|
| 22 |
-
"
|
| 23 |
-
"vision_tensor_data_bytes": 893142496,
|
| 24 |
-
"vision_weight_bytes_requantized": false,
|
| 25 |
-
"vlm_runtime_file": "modeling_mlx_vlm_qwen36_modelopt_hybrid.py",
|
| 26 |
"weight_bytes_requantized": false
|
| 27 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"converter": "convert_qwen36_modelopt_hybrid_to_mlx.py",
|
| 3 |
+
"conversion_lossless_from_source_quantized_weights": true,
|
| 4 |
"created_at": "2026-07-10T03:37:44.758817+00:00",
|
| 5 |
"input_scales_dropped": 30971,
|
|
|
|
| 6 |
"norm_weights_shifted": true,
|
| 7 |
"num_experts": 256,
|
| 8 |
"num_layers": 40,
|
| 9 |
"output": "mlx-community/Qwen3.6-35B-A3B-AntiLoop-NVFP4",
|
| 10 |
+
"output_shards": 41,
|
| 11 |
+
"output_tensor_count": 1475,
|
| 12 |
+
"output_total_size_bytes": 20865009900,
|
| 13 |
"quantized_module_counts": {
|
| 14 |
"scaled_mxfp8": 130,
|
| 15 |
"scaled_nvfp4": 121,
|
|
|
|
| 18 |
"runtime_file": "modeling_mlx_qwen36_modelopt_hybrid.py",
|
| 19 |
"source": "N8Programs/Qwen3.6-35B-A3B-AntiLoop-NVFP4@1fc377564024dce4e8e7f2bdc04d34cd869f928f",
|
| 20 |
"source_tensor_count": 124468,
|
| 21 |
+
"text_only": true,
|
| 22 |
+
"vision_weights_included": false,
|
|
|
|
|
|
|
|
|
|
| 23 |
"weight_bytes_requantized": false
|
| 24 |
}
|
mlx_vlm_model_file_loader.py
DELETED
|
@@ -1,121 +0,0 @@
|
|
| 1 |
-
"""Opt-in loader for model-local MLX-VLM architecture files.
|
| 2 |
-
|
| 3 |
-
MLX-VLM 0.6.4 does not yet consult ``vlm_model_file`` in a model config.
|
| 4 |
-
This module adds that one lookup in-process. It never edits the installed
|
| 5 |
-
``mlx_vlm`` package, and it only executes model-local code when the caller has
|
| 6 |
-
explicitly passed ``trust_remote_code=True``.
|
| 7 |
-
"""
|
| 8 |
-
|
| 9 |
-
from __future__ import annotations
|
| 10 |
-
|
| 11 |
-
import importlib.util
|
| 12 |
-
import sys
|
| 13 |
-
from contextvars import ContextVar
|
| 14 |
-
from pathlib import Path
|
| 15 |
-
from types import ModuleType
|
| 16 |
-
from typing import Any
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
_ACTIVE_MODEL_PATH: ContextVar[Path | None] = ContextVar(
|
| 20 |
-
"mlx_vlm_model_file_path", default=None
|
| 21 |
-
)
|
| 22 |
-
_ACTIVE_TRUST_REMOTE_CODE: ContextVar[bool] = ContextVar(
|
| 23 |
-
"mlx_vlm_model_file_trust", default=False
|
| 24 |
-
)
|
| 25 |
-
_MODULE_CACHE: dict[Path, ModuleType] = {}
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
def _load_local_module(model_path: Path, filename: str) -> ModuleType:
|
| 29 |
-
root = model_path.resolve()
|
| 30 |
-
module_path = (root / filename).resolve()
|
| 31 |
-
|
| 32 |
-
try:
|
| 33 |
-
module_path.relative_to(root)
|
| 34 |
-
except ValueError as exc:
|
| 35 |
-
raise ValueError(
|
| 36 |
-
f"vlm_model_file must stay inside the model directory: {filename!r}"
|
| 37 |
-
) from exc
|
| 38 |
-
|
| 39 |
-
if module_path.suffix != ".py" or not module_path.is_file():
|
| 40 |
-
raise FileNotFoundError(f"Model-local MLX-VLM runtime not found: {module_path}")
|
| 41 |
-
|
| 42 |
-
cached = _MODULE_CACHE.get(module_path)
|
| 43 |
-
if cached is not None:
|
| 44 |
-
return cached
|
| 45 |
-
|
| 46 |
-
module_name = f"mlx_vlm_remote_{abs(hash(str(module_path))):x}"
|
| 47 |
-
spec = importlib.util.spec_from_file_location(module_name, module_path)
|
| 48 |
-
if spec is None or spec.loader is None:
|
| 49 |
-
raise ImportError(f"Could not import model-local runtime: {module_path}")
|
| 50 |
-
|
| 51 |
-
module = importlib.util.module_from_spec(spec)
|
| 52 |
-
sys.modules[module_name] = module
|
| 53 |
-
try:
|
| 54 |
-
spec.loader.exec_module(module)
|
| 55 |
-
except Exception:
|
| 56 |
-
sys.modules.pop(module_name, None)
|
| 57 |
-
raise
|
| 58 |
-
|
| 59 |
-
_MODULE_CACHE[module_path] = module
|
| 60 |
-
return module
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
def install() -> None:
|
| 64 |
-
"""Install the model-file lookup into the current Python process."""
|
| 65 |
-
|
| 66 |
-
import mlx_vlm.utils as utils
|
| 67 |
-
|
| 68 |
-
if getattr(utils.get_model_and_args, "_model_file_loader_installed", False):
|
| 69 |
-
return
|
| 70 |
-
|
| 71 |
-
original_get_model_and_args = utils.get_model_and_args
|
| 72 |
-
original_load_model = utils.load_model
|
| 73 |
-
|
| 74 |
-
def get_model_and_args(config: dict, *args: Any, **kwargs: Any):
|
| 75 |
-
filename = config.get("vlm_model_file")
|
| 76 |
-
model_path = kwargs.get("model_path") or _ACTIVE_MODEL_PATH.get()
|
| 77 |
-
|
| 78 |
-
# Calls made later by processor setup do not carry a model path in
|
| 79 |
-
# MLX-VLM 0.6.4; let its native Qwen implementation handle those.
|
| 80 |
-
if not filename or model_path is None:
|
| 81 |
-
return original_get_model_and_args(config, *args, **kwargs)
|
| 82 |
-
|
| 83 |
-
trusted = bool(
|
| 84 |
-
kwargs.get("trust_remote_code", False)
|
| 85 |
-
or _ACTIVE_TRUST_REMOTE_CODE.get()
|
| 86 |
-
)
|
| 87 |
-
if not trusted:
|
| 88 |
-
raise PermissionError(
|
| 89 |
-
"This checkpoint includes a model-local MLX-VLM runtime. "
|
| 90 |
-
"Re-run with --trust-remote-code (or trust_remote_code=True)."
|
| 91 |
-
)
|
| 92 |
-
|
| 93 |
-
module = _load_local_module(Path(model_path), str(filename))
|
| 94 |
-
return module, f"model-local:{filename}"
|
| 95 |
-
|
| 96 |
-
def load_model(model_path: Path, lazy: bool = False, **kwargs: Any):
|
| 97 |
-
path_token = _ACTIVE_MODEL_PATH.set(Path(model_path))
|
| 98 |
-
trust_token = _ACTIVE_TRUST_REMOTE_CODE.set(
|
| 99 |
-
bool(kwargs.get("trust_remote_code", False))
|
| 100 |
-
)
|
| 101 |
-
try:
|
| 102 |
-
return original_load_model(model_path, lazy=lazy, **kwargs)
|
| 103 |
-
finally:
|
| 104 |
-
_ACTIVE_TRUST_REMOTE_CODE.reset(trust_token)
|
| 105 |
-
_ACTIVE_MODEL_PATH.reset(path_token)
|
| 106 |
-
|
| 107 |
-
get_model_and_args._model_file_loader_installed = True # type: ignore[attr-defined]
|
| 108 |
-
load_model._model_file_loader_installed = True # type: ignore[attr-defined]
|
| 109 |
-
utils.get_model_and_args = get_model_and_args
|
| 110 |
-
utils.load_model = load_model
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
def load(path_or_hf_repo: str, **kwargs: Any):
|
| 114 |
-
"""Programmatic convenience wrapper around :func:`mlx_vlm.load`."""
|
| 115 |
-
|
| 116 |
-
install()
|
| 117 |
-
kwargs.setdefault("trust_remote_code", True)
|
| 118 |
-
from mlx_vlm import load as mlx_vlm_load
|
| 119 |
-
|
| 120 |
-
return mlx_vlm_load(path_or_hf_repo, **kwargs)
|
| 121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
model-vision.safetensors
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:7949c801ab3672ddc5ba569a65a17eb836a7cddd121cefbff7deacbeeb2d25c9
|
| 3 |
-
size 893179784
|
|
|
|
|
|
|
|
|
|
|
|
model.safetensors.index.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"metadata": {
|
| 3 |
-
"total_size":
|
| 4 |
},
|
| 5 |
"weight_map": {
|
| 6 |
"language_model.lm_head.global_scale": "model-00001-of-00041.safetensors",
|
|
@@ -1477,339 +1477,6 @@
|
|
| 1477 |
"language_model.model.layers.9.mlp.switch_mlp.up_proj.scales": "model-00011-of-00041.safetensors",
|
| 1478 |
"language_model.model.layers.9.mlp.switch_mlp.up_proj.weight": "model-00011-of-00041.safetensors",
|
| 1479 |
"language_model.model.layers.9.post_attention_layernorm.weight": "model-00011-of-00041.safetensors",
|
| 1480 |
-
"language_model.model.norm.weight": "model-00001-of-00041.safetensors"
|
| 1481 |
-
"model.visual.blocks.0.attn.proj.bias": "model-vision.safetensors",
|
| 1482 |
-
"model.visual.blocks.0.attn.proj.weight": "model-vision.safetensors",
|
| 1483 |
-
"model.visual.blocks.0.attn.qkv.bias": "model-vision.safetensors",
|
| 1484 |
-
"model.visual.blocks.0.attn.qkv.weight": "model-vision.safetensors",
|
| 1485 |
-
"model.visual.blocks.0.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1486 |
-
"model.visual.blocks.0.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1487 |
-
"model.visual.blocks.0.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1488 |
-
"model.visual.blocks.0.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1489 |
-
"model.visual.blocks.0.norm1.bias": "model-vision.safetensors",
|
| 1490 |
-
"model.visual.blocks.0.norm1.weight": "model-vision.safetensors",
|
| 1491 |
-
"model.visual.blocks.0.norm2.bias": "model-vision.safetensors",
|
| 1492 |
-
"model.visual.blocks.0.norm2.weight": "model-vision.safetensors",
|
| 1493 |
-
"model.visual.blocks.1.attn.proj.bias": "model-vision.safetensors",
|
| 1494 |
-
"model.visual.blocks.1.attn.proj.weight": "model-vision.safetensors",
|
| 1495 |
-
"model.visual.blocks.1.attn.qkv.bias": "model-vision.safetensors",
|
| 1496 |
-
"model.visual.blocks.1.attn.qkv.weight": "model-vision.safetensors",
|
| 1497 |
-
"model.visual.blocks.1.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1498 |
-
"model.visual.blocks.1.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1499 |
-
"model.visual.blocks.1.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1500 |
-
"model.visual.blocks.1.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1501 |
-
"model.visual.blocks.1.norm1.bias": "model-vision.safetensors",
|
| 1502 |
-
"model.visual.blocks.1.norm1.weight": "model-vision.safetensors",
|
| 1503 |
-
"model.visual.blocks.1.norm2.bias": "model-vision.safetensors",
|
| 1504 |
-
"model.visual.blocks.1.norm2.weight": "model-vision.safetensors",
|
| 1505 |
-
"model.visual.blocks.10.attn.proj.bias": "model-vision.safetensors",
|
| 1506 |
-
"model.visual.blocks.10.attn.proj.weight": "model-vision.safetensors",
|
| 1507 |
-
"model.visual.blocks.10.attn.qkv.bias": "model-vision.safetensors",
|
| 1508 |
-
"model.visual.blocks.10.attn.qkv.weight": "model-vision.safetensors",
|
| 1509 |
-
"model.visual.blocks.10.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1510 |
-
"model.visual.blocks.10.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1511 |
-
"model.visual.blocks.10.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1512 |
-
"model.visual.blocks.10.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1513 |
-
"model.visual.blocks.10.norm1.bias": "model-vision.safetensors",
|
| 1514 |
-
"model.visual.blocks.10.norm1.weight": "model-vision.safetensors",
|
| 1515 |
-
"model.visual.blocks.10.norm2.bias": "model-vision.safetensors",
|
| 1516 |
-
"model.visual.blocks.10.norm2.weight": "model-vision.safetensors",
|
| 1517 |
-
"model.visual.blocks.11.attn.proj.bias": "model-vision.safetensors",
|
| 1518 |
-
"model.visual.blocks.11.attn.proj.weight": "model-vision.safetensors",
|
| 1519 |
-
"model.visual.blocks.11.attn.qkv.bias": "model-vision.safetensors",
|
| 1520 |
-
"model.visual.blocks.11.attn.qkv.weight": "model-vision.safetensors",
|
| 1521 |
-
"model.visual.blocks.11.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1522 |
-
"model.visual.blocks.11.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1523 |
-
"model.visual.blocks.11.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1524 |
-
"model.visual.blocks.11.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1525 |
-
"model.visual.blocks.11.norm1.bias": "model-vision.safetensors",
|
| 1526 |
-
"model.visual.blocks.11.norm1.weight": "model-vision.safetensors",
|
| 1527 |
-
"model.visual.blocks.11.norm2.bias": "model-vision.safetensors",
|
| 1528 |
-
"model.visual.blocks.11.norm2.weight": "model-vision.safetensors",
|
| 1529 |
-
"model.visual.blocks.12.attn.proj.bias": "model-vision.safetensors",
|
| 1530 |
-
"model.visual.blocks.12.attn.proj.weight": "model-vision.safetensors",
|
| 1531 |
-
"model.visual.blocks.12.attn.qkv.bias": "model-vision.safetensors",
|
| 1532 |
-
"model.visual.blocks.12.attn.qkv.weight": "model-vision.safetensors",
|
| 1533 |
-
"model.visual.blocks.12.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1534 |
-
"model.visual.blocks.12.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1535 |
-
"model.visual.blocks.12.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1536 |
-
"model.visual.blocks.12.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1537 |
-
"model.visual.blocks.12.norm1.bias": "model-vision.safetensors",
|
| 1538 |
-
"model.visual.blocks.12.norm1.weight": "model-vision.safetensors",
|
| 1539 |
-
"model.visual.blocks.12.norm2.bias": "model-vision.safetensors",
|
| 1540 |
-
"model.visual.blocks.12.norm2.weight": "model-vision.safetensors",
|
| 1541 |
-
"model.visual.blocks.13.attn.proj.bias": "model-vision.safetensors",
|
| 1542 |
-
"model.visual.blocks.13.attn.proj.weight": "model-vision.safetensors",
|
| 1543 |
-
"model.visual.blocks.13.attn.qkv.bias": "model-vision.safetensors",
|
| 1544 |
-
"model.visual.blocks.13.attn.qkv.weight": "model-vision.safetensors",
|
| 1545 |
-
"model.visual.blocks.13.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1546 |
-
"model.visual.blocks.13.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1547 |
-
"model.visual.blocks.13.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1548 |
-
"model.visual.blocks.13.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1549 |
-
"model.visual.blocks.13.norm1.bias": "model-vision.safetensors",
|
| 1550 |
-
"model.visual.blocks.13.norm1.weight": "model-vision.safetensors",
|
| 1551 |
-
"model.visual.blocks.13.norm2.bias": "model-vision.safetensors",
|
| 1552 |
-
"model.visual.blocks.13.norm2.weight": "model-vision.safetensors",
|
| 1553 |
-
"model.visual.blocks.14.attn.proj.bias": "model-vision.safetensors",
|
| 1554 |
-
"model.visual.blocks.14.attn.proj.weight": "model-vision.safetensors",
|
| 1555 |
-
"model.visual.blocks.14.attn.qkv.bias": "model-vision.safetensors",
|
| 1556 |
-
"model.visual.blocks.14.attn.qkv.weight": "model-vision.safetensors",
|
| 1557 |
-
"model.visual.blocks.14.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1558 |
-
"model.visual.blocks.14.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1559 |
-
"model.visual.blocks.14.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1560 |
-
"model.visual.blocks.14.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1561 |
-
"model.visual.blocks.14.norm1.bias": "model-vision.safetensors",
|
| 1562 |
-
"model.visual.blocks.14.norm1.weight": "model-vision.safetensors",
|
| 1563 |
-
"model.visual.blocks.14.norm2.bias": "model-vision.safetensors",
|
| 1564 |
-
"model.visual.blocks.14.norm2.weight": "model-vision.safetensors",
|
| 1565 |
-
"model.visual.blocks.15.attn.proj.bias": "model-vision.safetensors",
|
| 1566 |
-
"model.visual.blocks.15.attn.proj.weight": "model-vision.safetensors",
|
| 1567 |
-
"model.visual.blocks.15.attn.qkv.bias": "model-vision.safetensors",
|
| 1568 |
-
"model.visual.blocks.15.attn.qkv.weight": "model-vision.safetensors",
|
| 1569 |
-
"model.visual.blocks.15.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1570 |
-
"model.visual.blocks.15.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1571 |
-
"model.visual.blocks.15.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1572 |
-
"model.visual.blocks.15.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1573 |
-
"model.visual.blocks.15.norm1.bias": "model-vision.safetensors",
|
| 1574 |
-
"model.visual.blocks.15.norm1.weight": "model-vision.safetensors",
|
| 1575 |
-
"model.visual.blocks.15.norm2.bias": "model-vision.safetensors",
|
| 1576 |
-
"model.visual.blocks.15.norm2.weight": "model-vision.safetensors",
|
| 1577 |
-
"model.visual.blocks.16.attn.proj.bias": "model-vision.safetensors",
|
| 1578 |
-
"model.visual.blocks.16.attn.proj.weight": "model-vision.safetensors",
|
| 1579 |
-
"model.visual.blocks.16.attn.qkv.bias": "model-vision.safetensors",
|
| 1580 |
-
"model.visual.blocks.16.attn.qkv.weight": "model-vision.safetensors",
|
| 1581 |
-
"model.visual.blocks.16.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1582 |
-
"model.visual.blocks.16.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1583 |
-
"model.visual.blocks.16.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1584 |
-
"model.visual.blocks.16.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1585 |
-
"model.visual.blocks.16.norm1.bias": "model-vision.safetensors",
|
| 1586 |
-
"model.visual.blocks.16.norm1.weight": "model-vision.safetensors",
|
| 1587 |
-
"model.visual.blocks.16.norm2.bias": "model-vision.safetensors",
|
| 1588 |
-
"model.visual.blocks.16.norm2.weight": "model-vision.safetensors",
|
| 1589 |
-
"model.visual.blocks.17.attn.proj.bias": "model-vision.safetensors",
|
| 1590 |
-
"model.visual.blocks.17.attn.proj.weight": "model-vision.safetensors",
|
| 1591 |
-
"model.visual.blocks.17.attn.qkv.bias": "model-vision.safetensors",
|
| 1592 |
-
"model.visual.blocks.17.attn.qkv.weight": "model-vision.safetensors",
|
| 1593 |
-
"model.visual.blocks.17.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1594 |
-
"model.visual.blocks.17.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1595 |
-
"model.visual.blocks.17.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1596 |
-
"model.visual.blocks.17.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1597 |
-
"model.visual.blocks.17.norm1.bias": "model-vision.safetensors",
|
| 1598 |
-
"model.visual.blocks.17.norm1.weight": "model-vision.safetensors",
|
| 1599 |
-
"model.visual.blocks.17.norm2.bias": "model-vision.safetensors",
|
| 1600 |
-
"model.visual.blocks.17.norm2.weight": "model-vision.safetensors",
|
| 1601 |
-
"model.visual.blocks.18.attn.proj.bias": "model-vision.safetensors",
|
| 1602 |
-
"model.visual.blocks.18.attn.proj.weight": "model-vision.safetensors",
|
| 1603 |
-
"model.visual.blocks.18.attn.qkv.bias": "model-vision.safetensors",
|
| 1604 |
-
"model.visual.blocks.18.attn.qkv.weight": "model-vision.safetensors",
|
| 1605 |
-
"model.visual.blocks.18.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1606 |
-
"model.visual.blocks.18.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1607 |
-
"model.visual.blocks.18.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1608 |
-
"model.visual.blocks.18.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1609 |
-
"model.visual.blocks.18.norm1.bias": "model-vision.safetensors",
|
| 1610 |
-
"model.visual.blocks.18.norm1.weight": "model-vision.safetensors",
|
| 1611 |
-
"model.visual.blocks.18.norm2.bias": "model-vision.safetensors",
|
| 1612 |
-
"model.visual.blocks.18.norm2.weight": "model-vision.safetensors",
|
| 1613 |
-
"model.visual.blocks.19.attn.proj.bias": "model-vision.safetensors",
|
| 1614 |
-
"model.visual.blocks.19.attn.proj.weight": "model-vision.safetensors",
|
| 1615 |
-
"model.visual.blocks.19.attn.qkv.bias": "model-vision.safetensors",
|
| 1616 |
-
"model.visual.blocks.19.attn.qkv.weight": "model-vision.safetensors",
|
| 1617 |
-
"model.visual.blocks.19.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1618 |
-
"model.visual.blocks.19.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1619 |
-
"model.visual.blocks.19.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1620 |
-
"model.visual.blocks.19.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1621 |
-
"model.visual.blocks.19.norm1.bias": "model-vision.safetensors",
|
| 1622 |
-
"model.visual.blocks.19.norm1.weight": "model-vision.safetensors",
|
| 1623 |
-
"model.visual.blocks.19.norm2.bias": "model-vision.safetensors",
|
| 1624 |
-
"model.visual.blocks.19.norm2.weight": "model-vision.safetensors",
|
| 1625 |
-
"model.visual.blocks.2.attn.proj.bias": "model-vision.safetensors",
|
| 1626 |
-
"model.visual.blocks.2.attn.proj.weight": "model-vision.safetensors",
|
| 1627 |
-
"model.visual.blocks.2.attn.qkv.bias": "model-vision.safetensors",
|
| 1628 |
-
"model.visual.blocks.2.attn.qkv.weight": "model-vision.safetensors",
|
| 1629 |
-
"model.visual.blocks.2.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1630 |
-
"model.visual.blocks.2.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1631 |
-
"model.visual.blocks.2.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1632 |
-
"model.visual.blocks.2.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1633 |
-
"model.visual.blocks.2.norm1.bias": "model-vision.safetensors",
|
| 1634 |
-
"model.visual.blocks.2.norm1.weight": "model-vision.safetensors",
|
| 1635 |
-
"model.visual.blocks.2.norm2.bias": "model-vision.safetensors",
|
| 1636 |
-
"model.visual.blocks.2.norm2.weight": "model-vision.safetensors",
|
| 1637 |
-
"model.visual.blocks.20.attn.proj.bias": "model-vision.safetensors",
|
| 1638 |
-
"model.visual.blocks.20.attn.proj.weight": "model-vision.safetensors",
|
| 1639 |
-
"model.visual.blocks.20.attn.qkv.bias": "model-vision.safetensors",
|
| 1640 |
-
"model.visual.blocks.20.attn.qkv.weight": "model-vision.safetensors",
|
| 1641 |
-
"model.visual.blocks.20.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1642 |
-
"model.visual.blocks.20.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1643 |
-
"model.visual.blocks.20.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1644 |
-
"model.visual.blocks.20.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1645 |
-
"model.visual.blocks.20.norm1.bias": "model-vision.safetensors",
|
| 1646 |
-
"model.visual.blocks.20.norm1.weight": "model-vision.safetensors",
|
| 1647 |
-
"model.visual.blocks.20.norm2.bias": "model-vision.safetensors",
|
| 1648 |
-
"model.visual.blocks.20.norm2.weight": "model-vision.safetensors",
|
| 1649 |
-
"model.visual.blocks.21.attn.proj.bias": "model-vision.safetensors",
|
| 1650 |
-
"model.visual.blocks.21.attn.proj.weight": "model-vision.safetensors",
|
| 1651 |
-
"model.visual.blocks.21.attn.qkv.bias": "model-vision.safetensors",
|
| 1652 |
-
"model.visual.blocks.21.attn.qkv.weight": "model-vision.safetensors",
|
| 1653 |
-
"model.visual.blocks.21.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1654 |
-
"model.visual.blocks.21.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1655 |
-
"model.visual.blocks.21.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1656 |
-
"model.visual.blocks.21.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1657 |
-
"model.visual.blocks.21.norm1.bias": "model-vision.safetensors",
|
| 1658 |
-
"model.visual.blocks.21.norm1.weight": "model-vision.safetensors",
|
| 1659 |
-
"model.visual.blocks.21.norm2.bias": "model-vision.safetensors",
|
| 1660 |
-
"model.visual.blocks.21.norm2.weight": "model-vision.safetensors",
|
| 1661 |
-
"model.visual.blocks.22.attn.proj.bias": "model-vision.safetensors",
|
| 1662 |
-
"model.visual.blocks.22.attn.proj.weight": "model-vision.safetensors",
|
| 1663 |
-
"model.visual.blocks.22.attn.qkv.bias": "model-vision.safetensors",
|
| 1664 |
-
"model.visual.blocks.22.attn.qkv.weight": "model-vision.safetensors",
|
| 1665 |
-
"model.visual.blocks.22.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1666 |
-
"model.visual.blocks.22.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1667 |
-
"model.visual.blocks.22.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1668 |
-
"model.visual.blocks.22.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1669 |
-
"model.visual.blocks.22.norm1.bias": "model-vision.safetensors",
|
| 1670 |
-
"model.visual.blocks.22.norm1.weight": "model-vision.safetensors",
|
| 1671 |
-
"model.visual.blocks.22.norm2.bias": "model-vision.safetensors",
|
| 1672 |
-
"model.visual.blocks.22.norm2.weight": "model-vision.safetensors",
|
| 1673 |
-
"model.visual.blocks.23.attn.proj.bias": "model-vision.safetensors",
|
| 1674 |
-
"model.visual.blocks.23.attn.proj.weight": "model-vision.safetensors",
|
| 1675 |
-
"model.visual.blocks.23.attn.qkv.bias": "model-vision.safetensors",
|
| 1676 |
-
"model.visual.blocks.23.attn.qkv.weight": "model-vision.safetensors",
|
| 1677 |
-
"model.visual.blocks.23.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1678 |
-
"model.visual.blocks.23.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1679 |
-
"model.visual.blocks.23.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1680 |
-
"model.visual.blocks.23.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1681 |
-
"model.visual.blocks.23.norm1.bias": "model-vision.safetensors",
|
| 1682 |
-
"model.visual.blocks.23.norm1.weight": "model-vision.safetensors",
|
| 1683 |
-
"model.visual.blocks.23.norm2.bias": "model-vision.safetensors",
|
| 1684 |
-
"model.visual.blocks.23.norm2.weight": "model-vision.safetensors",
|
| 1685 |
-
"model.visual.blocks.24.attn.proj.bias": "model-vision.safetensors",
|
| 1686 |
-
"model.visual.blocks.24.attn.proj.weight": "model-vision.safetensors",
|
| 1687 |
-
"model.visual.blocks.24.attn.qkv.bias": "model-vision.safetensors",
|
| 1688 |
-
"model.visual.blocks.24.attn.qkv.weight": "model-vision.safetensors",
|
| 1689 |
-
"model.visual.blocks.24.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1690 |
-
"model.visual.blocks.24.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1691 |
-
"model.visual.blocks.24.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1692 |
-
"model.visual.blocks.24.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1693 |
-
"model.visual.blocks.24.norm1.bias": "model-vision.safetensors",
|
| 1694 |
-
"model.visual.blocks.24.norm1.weight": "model-vision.safetensors",
|
| 1695 |
-
"model.visual.blocks.24.norm2.bias": "model-vision.safetensors",
|
| 1696 |
-
"model.visual.blocks.24.norm2.weight": "model-vision.safetensors",
|
| 1697 |
-
"model.visual.blocks.25.attn.proj.bias": "model-vision.safetensors",
|
| 1698 |
-
"model.visual.blocks.25.attn.proj.weight": "model-vision.safetensors",
|
| 1699 |
-
"model.visual.blocks.25.attn.qkv.bias": "model-vision.safetensors",
|
| 1700 |
-
"model.visual.blocks.25.attn.qkv.weight": "model-vision.safetensors",
|
| 1701 |
-
"model.visual.blocks.25.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1702 |
-
"model.visual.blocks.25.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1703 |
-
"model.visual.blocks.25.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1704 |
-
"model.visual.blocks.25.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1705 |
-
"model.visual.blocks.25.norm1.bias": "model-vision.safetensors",
|
| 1706 |
-
"model.visual.blocks.25.norm1.weight": "model-vision.safetensors",
|
| 1707 |
-
"model.visual.blocks.25.norm2.bias": "model-vision.safetensors",
|
| 1708 |
-
"model.visual.blocks.25.norm2.weight": "model-vision.safetensors",
|
| 1709 |
-
"model.visual.blocks.26.attn.proj.bias": "model-vision.safetensors",
|
| 1710 |
-
"model.visual.blocks.26.attn.proj.weight": "model-vision.safetensors",
|
| 1711 |
-
"model.visual.blocks.26.attn.qkv.bias": "model-vision.safetensors",
|
| 1712 |
-
"model.visual.blocks.26.attn.qkv.weight": "model-vision.safetensors",
|
| 1713 |
-
"model.visual.blocks.26.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1714 |
-
"model.visual.blocks.26.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1715 |
-
"model.visual.blocks.26.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1716 |
-
"model.visual.blocks.26.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1717 |
-
"model.visual.blocks.26.norm1.bias": "model-vision.safetensors",
|
| 1718 |
-
"model.visual.blocks.26.norm1.weight": "model-vision.safetensors",
|
| 1719 |
-
"model.visual.blocks.26.norm2.bias": "model-vision.safetensors",
|
| 1720 |
-
"model.visual.blocks.26.norm2.weight": "model-vision.safetensors",
|
| 1721 |
-
"model.visual.blocks.3.attn.proj.bias": "model-vision.safetensors",
|
| 1722 |
-
"model.visual.blocks.3.attn.proj.weight": "model-vision.safetensors",
|
| 1723 |
-
"model.visual.blocks.3.attn.qkv.bias": "model-vision.safetensors",
|
| 1724 |
-
"model.visual.blocks.3.attn.qkv.weight": "model-vision.safetensors",
|
| 1725 |
-
"model.visual.blocks.3.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1726 |
-
"model.visual.blocks.3.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1727 |
-
"model.visual.blocks.3.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1728 |
-
"model.visual.blocks.3.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1729 |
-
"model.visual.blocks.3.norm1.bias": "model-vision.safetensors",
|
| 1730 |
-
"model.visual.blocks.3.norm1.weight": "model-vision.safetensors",
|
| 1731 |
-
"model.visual.blocks.3.norm2.bias": "model-vision.safetensors",
|
| 1732 |
-
"model.visual.blocks.3.norm2.weight": "model-vision.safetensors",
|
| 1733 |
-
"model.visual.blocks.4.attn.proj.bias": "model-vision.safetensors",
|
| 1734 |
-
"model.visual.blocks.4.attn.proj.weight": "model-vision.safetensors",
|
| 1735 |
-
"model.visual.blocks.4.attn.qkv.bias": "model-vision.safetensors",
|
| 1736 |
-
"model.visual.blocks.4.attn.qkv.weight": "model-vision.safetensors",
|
| 1737 |
-
"model.visual.blocks.4.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1738 |
-
"model.visual.blocks.4.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1739 |
-
"model.visual.blocks.4.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1740 |
-
"model.visual.blocks.4.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1741 |
-
"model.visual.blocks.4.norm1.bias": "model-vision.safetensors",
|
| 1742 |
-
"model.visual.blocks.4.norm1.weight": "model-vision.safetensors",
|
| 1743 |
-
"model.visual.blocks.4.norm2.bias": "model-vision.safetensors",
|
| 1744 |
-
"model.visual.blocks.4.norm2.weight": "model-vision.safetensors",
|
| 1745 |
-
"model.visual.blocks.5.attn.proj.bias": "model-vision.safetensors",
|
| 1746 |
-
"model.visual.blocks.5.attn.proj.weight": "model-vision.safetensors",
|
| 1747 |
-
"model.visual.blocks.5.attn.qkv.bias": "model-vision.safetensors",
|
| 1748 |
-
"model.visual.blocks.5.attn.qkv.weight": "model-vision.safetensors",
|
| 1749 |
-
"model.visual.blocks.5.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1750 |
-
"model.visual.blocks.5.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1751 |
-
"model.visual.blocks.5.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1752 |
-
"model.visual.blocks.5.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1753 |
-
"model.visual.blocks.5.norm1.bias": "model-vision.safetensors",
|
| 1754 |
-
"model.visual.blocks.5.norm1.weight": "model-vision.safetensors",
|
| 1755 |
-
"model.visual.blocks.5.norm2.bias": "model-vision.safetensors",
|
| 1756 |
-
"model.visual.blocks.5.norm2.weight": "model-vision.safetensors",
|
| 1757 |
-
"model.visual.blocks.6.attn.proj.bias": "model-vision.safetensors",
|
| 1758 |
-
"model.visual.blocks.6.attn.proj.weight": "model-vision.safetensors",
|
| 1759 |
-
"model.visual.blocks.6.attn.qkv.bias": "model-vision.safetensors",
|
| 1760 |
-
"model.visual.blocks.6.attn.qkv.weight": "model-vision.safetensors",
|
| 1761 |
-
"model.visual.blocks.6.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1762 |
-
"model.visual.blocks.6.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1763 |
-
"model.visual.blocks.6.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1764 |
-
"model.visual.blocks.6.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1765 |
-
"model.visual.blocks.6.norm1.bias": "model-vision.safetensors",
|
| 1766 |
-
"model.visual.blocks.6.norm1.weight": "model-vision.safetensors",
|
| 1767 |
-
"model.visual.blocks.6.norm2.bias": "model-vision.safetensors",
|
| 1768 |
-
"model.visual.blocks.6.norm2.weight": "model-vision.safetensors",
|
| 1769 |
-
"model.visual.blocks.7.attn.proj.bias": "model-vision.safetensors",
|
| 1770 |
-
"model.visual.blocks.7.attn.proj.weight": "model-vision.safetensors",
|
| 1771 |
-
"model.visual.blocks.7.attn.qkv.bias": "model-vision.safetensors",
|
| 1772 |
-
"model.visual.blocks.7.attn.qkv.weight": "model-vision.safetensors",
|
| 1773 |
-
"model.visual.blocks.7.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1774 |
-
"model.visual.blocks.7.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1775 |
-
"model.visual.blocks.7.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1776 |
-
"model.visual.blocks.7.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1777 |
-
"model.visual.blocks.7.norm1.bias": "model-vision.safetensors",
|
| 1778 |
-
"model.visual.blocks.7.norm1.weight": "model-vision.safetensors",
|
| 1779 |
-
"model.visual.blocks.7.norm2.bias": "model-vision.safetensors",
|
| 1780 |
-
"model.visual.blocks.7.norm2.weight": "model-vision.safetensors",
|
| 1781 |
-
"model.visual.blocks.8.attn.proj.bias": "model-vision.safetensors",
|
| 1782 |
-
"model.visual.blocks.8.attn.proj.weight": "model-vision.safetensors",
|
| 1783 |
-
"model.visual.blocks.8.attn.qkv.bias": "model-vision.safetensors",
|
| 1784 |
-
"model.visual.blocks.8.attn.qkv.weight": "model-vision.safetensors",
|
| 1785 |
-
"model.visual.blocks.8.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1786 |
-
"model.visual.blocks.8.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1787 |
-
"model.visual.blocks.8.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1788 |
-
"model.visual.blocks.8.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1789 |
-
"model.visual.blocks.8.norm1.bias": "model-vision.safetensors",
|
| 1790 |
-
"model.visual.blocks.8.norm1.weight": "model-vision.safetensors",
|
| 1791 |
-
"model.visual.blocks.8.norm2.bias": "model-vision.safetensors",
|
| 1792 |
-
"model.visual.blocks.8.norm2.weight": "model-vision.safetensors",
|
| 1793 |
-
"model.visual.blocks.9.attn.proj.bias": "model-vision.safetensors",
|
| 1794 |
-
"model.visual.blocks.9.attn.proj.weight": "model-vision.safetensors",
|
| 1795 |
-
"model.visual.blocks.9.attn.qkv.bias": "model-vision.safetensors",
|
| 1796 |
-
"model.visual.blocks.9.attn.qkv.weight": "model-vision.safetensors",
|
| 1797 |
-
"model.visual.blocks.9.mlp.linear_fc1.bias": "model-vision.safetensors",
|
| 1798 |
-
"model.visual.blocks.9.mlp.linear_fc1.weight": "model-vision.safetensors",
|
| 1799 |
-
"model.visual.blocks.9.mlp.linear_fc2.bias": "model-vision.safetensors",
|
| 1800 |
-
"model.visual.blocks.9.mlp.linear_fc2.weight": "model-vision.safetensors",
|
| 1801 |
-
"model.visual.blocks.9.norm1.bias": "model-vision.safetensors",
|
| 1802 |
-
"model.visual.blocks.9.norm1.weight": "model-vision.safetensors",
|
| 1803 |
-
"model.visual.blocks.9.norm2.bias": "model-vision.safetensors",
|
| 1804 |
-
"model.visual.blocks.9.norm2.weight": "model-vision.safetensors",
|
| 1805 |
-
"model.visual.merger.linear_fc1.bias": "model-vision.safetensors",
|
| 1806 |
-
"model.visual.merger.linear_fc1.weight": "model-vision.safetensors",
|
| 1807 |
-
"model.visual.merger.linear_fc2.bias": "model-vision.safetensors",
|
| 1808 |
-
"model.visual.merger.linear_fc2.weight": "model-vision.safetensors",
|
| 1809 |
-
"model.visual.merger.norm.bias": "model-vision.safetensors",
|
| 1810 |
-
"model.visual.merger.norm.weight": "model-vision.safetensors",
|
| 1811 |
-
"model.visual.patch_embed.proj.bias": "model-vision.safetensors",
|
| 1812 |
-
"model.visual.patch_embed.proj.weight": "model-vision.safetensors",
|
| 1813 |
-
"model.visual.pos_embed.weight": "model-vision.safetensors"
|
| 1814 |
}
|
| 1815 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"metadata": {
|
| 3 |
+
"total_size": 20865009900
|
| 4 |
},
|
| 5 |
"weight_map": {
|
| 6 |
"language_model.lm_head.global_scale": "model-00001-of-00041.safetensors",
|
|
|
|
| 1477 |
"language_model.model.layers.9.mlp.switch_mlp.up_proj.scales": "model-00011-of-00041.safetensors",
|
| 1478 |
"language_model.model.layers.9.mlp.switch_mlp.up_proj.weight": "model-00011-of-00041.safetensors",
|
| 1479 |
"language_model.model.layers.9.post_attention_layernorm.weight": "model-00011-of-00041.safetensors",
|
| 1480 |
+
"language_model.model.norm.weight": "model-00001-of-00041.safetensors"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1481 |
}
|
| 1482 |
}
|
modeling_mlx_vlm_qwen36_modelopt_hybrid.py
DELETED
|
@@ -1,217 +0,0 @@
|
|
| 1 |
-
"""MLX-VLM runtime for Qwen3.6 ModelOpt hybrid FP8/NVFP4 checkpoints.
|
| 2 |
-
|
| 3 |
-
The language model keeps the lossless ModelOpt-to-MLX representation used by
|
| 4 |
-
``modeling_mlx_qwen36_modelopt_hybrid.py``. The vision tower remains in its
|
| 5 |
-
original BF16 representation and is delegated to MLX-VLM's native Qwen3.5 MoE
|
| 6 |
-
vision implementation.
|
| 7 |
-
|
| 8 |
-
This module intentionally exports the same public symbols as an MLX-VLM model
|
| 9 |
-
package so a model-local loader can select it without changing ``model_type``.
|
| 10 |
-
"""
|
| 11 |
-
|
| 12 |
-
from dataclasses import dataclass, field
|
| 13 |
-
from typing import Dict
|
| 14 |
-
|
| 15 |
-
import mlx.core as mx
|
| 16 |
-
import mlx.nn as nn
|
| 17 |
-
from mlx.utils import tree_flatten, tree_unflatten
|
| 18 |
-
|
| 19 |
-
from mlx_vlm.models.qwen3_5_moe import LanguageModel, TextConfig, VisionConfig
|
| 20 |
-
from mlx_vlm.models.qwen3_5_moe import Model as BaseModel
|
| 21 |
-
from mlx_vlm.models.qwen3_5_moe import ModelConfig as BaseModelConfig
|
| 22 |
-
from mlx_vlm.models.qwen3_5_moe import VisionModel
|
| 23 |
-
from mlx_vlm.models.switch_layers import SwitchLinear
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
@dataclass
|
| 27 |
-
class ModelConfig(BaseModelConfig):
|
| 28 |
-
mlx_modelopt_quantization: Dict[str, str] = field(default_factory=dict)
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
class ScaledQuantizedLinear(nn.Module):
|
| 32 |
-
"""Weight-quantized dense linear with a ModelOpt tensor scale."""
|
| 33 |
-
|
| 34 |
-
def __init__(
|
| 35 |
-
self,
|
| 36 |
-
input_dims: int,
|
| 37 |
-
output_dims: int,
|
| 38 |
-
*,
|
| 39 |
-
group_size: int,
|
| 40 |
-
bits: int,
|
| 41 |
-
mode: str,
|
| 42 |
-
bias: bool = False,
|
| 43 |
-
):
|
| 44 |
-
super().__init__()
|
| 45 |
-
if input_dims % group_size:
|
| 46 |
-
raise ValueError(
|
| 47 |
-
f"input_dims={input_dims} is not divisible by group_size={group_size}"
|
| 48 |
-
)
|
| 49 |
-
if (input_dims * bits) % 32:
|
| 50 |
-
raise ValueError(
|
| 51 |
-
f"input_dims={input_dims}, bits={bits} cannot be packed into uint32"
|
| 52 |
-
)
|
| 53 |
-
|
| 54 |
-
self.group_size = group_size
|
| 55 |
-
self.bits = bits
|
| 56 |
-
self.mode = mode
|
| 57 |
-
self.weight = mx.zeros(
|
| 58 |
-
(output_dims, input_dims * bits // 32), dtype=mx.uint32
|
| 59 |
-
)
|
| 60 |
-
self.scales = mx.zeros(
|
| 61 |
-
(output_dims, input_dims // group_size), dtype=mx.uint8
|
| 62 |
-
)
|
| 63 |
-
self.global_scale = mx.ones((), dtype=mx.float32)
|
| 64 |
-
if bias:
|
| 65 |
-
self.bias = mx.zeros((output_dims,))
|
| 66 |
-
self.freeze()
|
| 67 |
-
|
| 68 |
-
@classmethod
|
| 69 |
-
def from_linear(cls, linear: nn.Module, kind: str):
|
| 70 |
-
output_dims, input_dims = linear.weight.shape
|
| 71 |
-
has_bias = linear.get("bias") is not None
|
| 72 |
-
if kind == "scaled_mxfp8":
|
| 73 |
-
params = dict(group_size=32, bits=8, mode="mxfp8")
|
| 74 |
-
elif kind == "scaled_nvfp4":
|
| 75 |
-
params = dict(group_size=16, bits=4, mode="nvfp4")
|
| 76 |
-
else:
|
| 77 |
-
raise ValueError(f"Unsupported dense quantization kind: {kind}")
|
| 78 |
-
return cls(input_dims, output_dims, bias=has_bias, **params)
|
| 79 |
-
|
| 80 |
-
def __call__(self, x):
|
| 81 |
-
y = mx.quantized_matmul(
|
| 82 |
-
x,
|
| 83 |
-
self["weight"],
|
| 84 |
-
self["scales"],
|
| 85 |
-
transpose=True,
|
| 86 |
-
group_size=self.group_size,
|
| 87 |
-
bits=self.bits,
|
| 88 |
-
mode=self.mode,
|
| 89 |
-
)
|
| 90 |
-
y = y * self["global_scale"].astype(y.dtype)
|
| 91 |
-
if "bias" in self:
|
| 92 |
-
y = y + self["bias"]
|
| 93 |
-
return y
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
class ScaledNVFP4SwitchLinear(nn.Module):
|
| 97 |
-
"""Expert linear using MLX gather_qmm and per-expert tensor scales."""
|
| 98 |
-
|
| 99 |
-
group_size = 16
|
| 100 |
-
bits = 4
|
| 101 |
-
mode = "nvfp4"
|
| 102 |
-
|
| 103 |
-
def __init__(
|
| 104 |
-
self,
|
| 105 |
-
input_dims: int,
|
| 106 |
-
output_dims: int,
|
| 107 |
-
num_experts: int,
|
| 108 |
-
*,
|
| 109 |
-
bias: bool = False,
|
| 110 |
-
):
|
| 111 |
-
super().__init__()
|
| 112 |
-
if input_dims % self.group_size:
|
| 113 |
-
raise ValueError(
|
| 114 |
-
f"input_dims={input_dims} is not divisible by {self.group_size}"
|
| 115 |
-
)
|
| 116 |
-
self.weight = mx.zeros(
|
| 117 |
-
(num_experts, output_dims, input_dims * self.bits // 32),
|
| 118 |
-
dtype=mx.uint32,
|
| 119 |
-
)
|
| 120 |
-
self.scales = mx.zeros(
|
| 121 |
-
(num_experts, output_dims, input_dims // self.group_size),
|
| 122 |
-
dtype=mx.uint8,
|
| 123 |
-
)
|
| 124 |
-
self.global_scales = mx.ones((num_experts,), dtype=mx.float32)
|
| 125 |
-
if bias:
|
| 126 |
-
self.bias = mx.zeros((num_experts, output_dims))
|
| 127 |
-
self.freeze()
|
| 128 |
-
|
| 129 |
-
@classmethod
|
| 130 |
-
def from_switch_linear(cls, linear: SwitchLinear):
|
| 131 |
-
num_experts, output_dims, input_dims = linear.weight.shape
|
| 132 |
-
has_bias = linear.get("bias") is not None
|
| 133 |
-
return cls(input_dims, output_dims, num_experts, bias=has_bias)
|
| 134 |
-
|
| 135 |
-
@property
|
| 136 |
-
def input_dims(self):
|
| 137 |
-
return self.scales.shape[2] * self.group_size
|
| 138 |
-
|
| 139 |
-
@property
|
| 140 |
-
def output_dims(self):
|
| 141 |
-
return self.weight.shape[1]
|
| 142 |
-
|
| 143 |
-
@property
|
| 144 |
-
def num_experts(self):
|
| 145 |
-
return self.weight.shape[0]
|
| 146 |
-
|
| 147 |
-
def __call__(self, x, indices, sorted_indices=False):
|
| 148 |
-
y = mx.gather_qmm(
|
| 149 |
-
x,
|
| 150 |
-
self["weight"],
|
| 151 |
-
self["scales"],
|
| 152 |
-
rhs_indices=indices,
|
| 153 |
-
transpose=True,
|
| 154 |
-
group_size=self.group_size,
|
| 155 |
-
bits=self.bits,
|
| 156 |
-
mode=self.mode,
|
| 157 |
-
sorted_indices=sorted_indices,
|
| 158 |
-
)
|
| 159 |
-
scale = self["global_scales"][indices].astype(y.dtype)[..., None, None]
|
| 160 |
-
y = y * scale
|
| 161 |
-
if "bias" in self:
|
| 162 |
-
y = y + mx.expand_dims(self["bias"][indices], -2)
|
| 163 |
-
return y
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
def _replace_quantized_modules(model: nn.Module, quantization: Dict[str, str]):
|
| 167 |
-
leaves = dict(
|
| 168 |
-
tree_flatten(model.leaf_modules(), is_leaf=lambda m: isinstance(m, nn.Module))
|
| 169 |
-
)
|
| 170 |
-
missing = sorted(set(quantization) - set(leaves))
|
| 171 |
-
if missing:
|
| 172 |
-
preview = "\n ".join(missing[:20])
|
| 173 |
-
raise ValueError(f"Quantized module paths are absent from the model:\n {preview}")
|
| 174 |
-
|
| 175 |
-
for path, kind in quantization.items():
|
| 176 |
-
module = leaves[path]
|
| 177 |
-
if kind in ("scaled_mxfp8", "scaled_nvfp4"):
|
| 178 |
-
if not isinstance(module, nn.Linear):
|
| 179 |
-
raise TypeError(f"{path} is {type(module).__name__}, expected Linear")
|
| 180 |
-
leaves[path] = ScaledQuantizedLinear.from_linear(module, kind)
|
| 181 |
-
elif kind == "scaled_nvfp4_switch":
|
| 182 |
-
if not isinstance(module, SwitchLinear):
|
| 183 |
-
raise TypeError(
|
| 184 |
-
f"{path} is {type(module).__name__}, expected SwitchLinear"
|
| 185 |
-
)
|
| 186 |
-
leaves[path] = ScaledNVFP4SwitchLinear.from_switch_linear(module)
|
| 187 |
-
else:
|
| 188 |
-
raise ValueError(f"Unknown quantization kind {kind!r} for {path}")
|
| 189 |
-
|
| 190 |
-
model.update_modules(tree_unflatten(list(leaves.items())))
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
class Model(BaseModel):
|
| 194 |
-
def __init__(self, config: ModelConfig):
|
| 195 |
-
super().__init__(config)
|
| 196 |
-
_replace_quantized_modules(self, config.mlx_modelopt_quantization)
|
| 197 |
-
|
| 198 |
-
def sanitize(self, weights):
|
| 199 |
-
"""Map only raw source keys; converted language keys are already sanitized."""
|
| 200 |
-
sanitized = {}
|
| 201 |
-
for key, value in weights.items():
|
| 202 |
-
if "mtp." in key:
|
| 203 |
-
continue
|
| 204 |
-
if key.startswith("model.language_model.visual"):
|
| 205 |
-
key = key.replace(
|
| 206 |
-
"model.language_model.visual", "vision_tower", 1
|
| 207 |
-
)
|
| 208 |
-
elif key.startswith("model.language_model"):
|
| 209 |
-
key = key.replace(
|
| 210 |
-
"model.language_model", "language_model.model", 1
|
| 211 |
-
)
|
| 212 |
-
elif key.startswith("model.visual"):
|
| 213 |
-
key = key.replace("model.visual", "vision_tower", 1)
|
| 214 |
-
elif key.startswith("lm_head"):
|
| 215 |
-
key = key.replace("lm_head", "language_model.lm_head", 1)
|
| 216 |
-
sanitized[key] = value
|
| 217 |
-
return sanitized
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
preprocessor_config.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"size": {
|
| 3 |
-
"longest_edge": 16777216,
|
| 4 |
-
"shortest_edge": 65536
|
| 5 |
-
},
|
| 6 |
-
"patch_size": 16,
|
| 7 |
-
"temporal_patch_size": 2,
|
| 8 |
-
"merge_size": 2,
|
| 9 |
-
"image_mean": [
|
| 10 |
-
0.5,
|
| 11 |
-
0.5,
|
| 12 |
-
0.5
|
| 13 |
-
],
|
| 14 |
-
"image_std": [
|
| 15 |
-
0.5,
|
| 16 |
-
0.5,
|
| 17 |
-
0.5
|
| 18 |
-
],
|
| 19 |
-
"processor_class": "Qwen3VLProcessor",
|
| 20 |
-
"image_processor_type": "Qwen2VLImageProcessorFast"
|
| 21 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
run_mlx_vlm.py
DELETED
|
@@ -1,12 +0,0 @@
|
|
| 1 |
-
"""Run the MLX-VLM generation CLI with model-local runtime support."""
|
| 2 |
-
|
| 3 |
-
from mlx_vlm_model_file_loader import install
|
| 4 |
-
|
| 5 |
-
install()
|
| 6 |
-
|
| 7 |
-
from mlx_vlm.generate.cli import main # noqa: E402
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
if __name__ == "__main__":
|
| 11 |
-
main()
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
run_mlx_vlm_server.py
DELETED
|
@@ -1,12 +0,0 @@
|
|
| 1 |
-
"""Run the MLX-VLM HTTP server with model-local runtime support."""
|
| 2 |
-
|
| 3 |
-
from mlx_vlm_model_file_loader import install
|
| 4 |
-
|
| 5 |
-
install()
|
| 6 |
-
|
| 7 |
-
from mlx_vlm.server.cli import main # noqa: E402
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
if __name__ == "__main__":
|
| 11 |
-
main()
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
video_preprocessor_config.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"size": {
|
| 3 |
-
"longest_edge": 25165824,
|
| 4 |
-
"shortest_edge": 4096
|
| 5 |
-
},
|
| 6 |
-
"patch_size": 16,
|
| 7 |
-
"temporal_patch_size": 2,
|
| 8 |
-
"merge_size": 2,
|
| 9 |
-
"image_mean": [
|
| 10 |
-
0.5,
|
| 11 |
-
0.5,
|
| 12 |
-
0.5
|
| 13 |
-
],
|
| 14 |
-
"image_std": [
|
| 15 |
-
0.5,
|
| 16 |
-
0.5,
|
| 17 |
-
0.5
|
| 18 |
-
],
|
| 19 |
-
"processor_class": "Qwen3VLProcessor",
|
| 20 |
-
"video_processor_type": "Qwen3VLVideoProcessor"
|
| 21 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|