Image-Text-to-Text
Transformers
Safetensors
minimax_m3_vl
multimodal
Mixture of Experts
agent
coding
video
conversational
custom_code
4-bit precision
auto-round
Instructions to use bullerwins/MiniMax-M3-4bit-W4A16-v0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bullerwins/MiniMax-M3-4bit-W4A16-v0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="bullerwins/MiniMax-M3-4bit-W4A16-v0", trust_remote_code=True) 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("bullerwins/MiniMax-M3-4bit-W4A16-v0", trust_remote_code=True) model = AutoModelForMultimodalLM.from_pretrained("bullerwins/MiniMax-M3-4bit-W4A16-v0", trust_remote_code=True, 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use bullerwins/MiniMax-M3-4bit-W4A16-v0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bullerwins/MiniMax-M3-4bit-W4A16-v0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bullerwins/MiniMax-M3-4bit-W4A16-v0", "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/bullerwins/MiniMax-M3-4bit-W4A16-v0
- SGLang
How to use bullerwins/MiniMax-M3-4bit-W4A16-v0 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 "bullerwins/MiniMax-M3-4bit-W4A16-v0" \ --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": "bullerwins/MiniMax-M3-4bit-W4A16-v0", "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 "bullerwins/MiniMax-M3-4bit-W4A16-v0" \ --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": "bullerwins/MiniMax-M3-4bit-W4A16-v0", "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 bullerwins/MiniMax-M3-4bit-W4A16-v0 with Docker Model Runner:
docker model run hf.co/bullerwins/MiniMax-M3-4bit-W4A16-v0
Add files using upload-large-folder tool
Browse files- .gitattributes +1 -0
- LICENSE +17 -0
- README.md +87 -0
- added_tokens.json +63 -0
- chat_template.jinja +247 -0
- config.json +1317 -0
- configuration_minimax_m3_vl.py +111 -0
- figures/efficiency_gqa_vs_msa.png +0 -0
- figures/logo.svg +16 -0
- generation_config.json +8 -0
- image_processor.py +223 -0
- merges.txt +0 -0
- model-00002-of-00059.safetensors +3 -0
- model-00003-of-00059.safetensors +3 -0
- model-00004-of-00059.safetensors +3 -0
- model-00005-of-00059.safetensors +3 -0
- model-00008-of-00059.safetensors +3 -0
- model-00009-of-00059.safetensors +3 -0
- model-00010-of-00059.safetensors +3 -0
- model-00012-of-00059.safetensors +3 -0
- model-00013-of-00059.safetensors +3 -0
- model-00014-of-00059.safetensors +3 -0
- model-00015-of-00059.safetensors +3 -0
- model-00018-of-00059.safetensors +3 -0
- model-00019-of-00059.safetensors +3 -0
- model-00020-of-00059.safetensors +3 -0
- model-00021-of-00059.safetensors +3 -0
- model-00026-of-00059.safetensors +3 -0
- model-00027-of-00059.safetensors +3 -0
- model-00030-of-00059.safetensors +3 -0
- model-00031-of-00059.safetensors +3 -0
- model-00036-of-00059.safetensors +3 -0
- model-00037-of-00059.safetensors +3 -0
- model-00040-of-00059.safetensors +3 -0
- model-00041-of-00059.safetensors +3 -0
- model-00046-of-00059.safetensors +3 -0
- model-00047-of-00059.safetensors +3 -0
- model-00050-of-00059.safetensors +3 -0
- model-00051-of-00059.safetensors +3 -0
- model-00056-of-00059.safetensors +3 -0
- model-00057-of-00059.safetensors +3 -0
- model.safetensors.index.json +0 -0
- preprocessor_config.json +32 -0
- processing_minimax.py +254 -0
- quantization_config.json +1033 -0
- special_tokens_map.json +16 -0
- tokenizer.json +0 -0
- tokenizer_config.json +501 -0
- video_processor.py +208 -0
- vocab.json +0 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
figures/benchmark.jpeg filter=lfs diff=lfs merge=lfs -text
|
LICENSE
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MINIMAX COMMUNITY LICENSE
|
| 2 |
+
Copyright (c) 2026 MiniMax
|
| 3 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software for non-commercial purposes, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or provide copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
| 4 |
+
1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
| 5 |
+
2. If the Software (or any derivative works thereof) is used for any Commercial Use for your products or services:
|
| 6 |
+
1. you shall prominently display “Built with MiniMax M3” on a related website, user interface, blogpost, about page or product documentation.
|
| 7 |
+
2. you shall obtain a separate, prior written authorization from MiniMax by contacting api@minimax.io with the subject line “M3 licensing - authorization request”, if such products and services generate more than 20 million US dollars (or equivalent in other currencies) in yearly revenue; otherwise, you only need to send a one-time notice to api@minimax.io with the subject “M3 licensing — notice”.
|
| 8 |
+
3. “Commercial Use” means any use of the Software or any derivative work thereof that is primarily intended for commercial advantage or monetary compensation, which includes, without limitation: (i) offering products or services to third parties for a fee, which utilize, incorporate, or rely on the Software or its derivatives, (ii) the commercial use of APIs provided by or for the Software or its derivatives, including to support or enable commercial products, services, or operations, whether in a cloud-based, hosted, or other similar environment, and (iii) the deployment or provision of the Software or its derivatives that have been subjected to post-training, fine-tuning, instruction-tuning, or any other form of modification, for any commercial purpose.
|
| 9 |
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 10 |
+
|
| 11 |
+
Appendix: Prohibited Uses
|
| 12 |
+
You agree you will not use, or allow others to use, the Software or any derivatives of the Software to:
|
| 13 |
+
1. Generate or disseminate content prohibited by applicable laws or regulations.
|
| 14 |
+
2. Assist with, engage in or otherwise support any military purpose.
|
| 15 |
+
3. Exploit, harm, or attempt to exploit or harm minors.
|
| 16 |
+
4. Generate or disseminate false or misleading information with the intent to cause harm.
|
| 17 |
+
5. Promote discrimination, hate speech, or harmful behavior against individuals or groups based on race or ethnic origin, religion, disability, age, nationality and national origin, veteran status, sexual orientation, gender or gender identity, caste, immigration status, or any other characteristic that is associated with systemic discrimination or marginalization.
|
README.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pipeline_tag: image-text-to-text
|
| 3 |
+
license: other
|
| 4 |
+
license_name: minimax-community
|
| 5 |
+
license_link: LICENSE
|
| 6 |
+
library_name: transformers
|
| 7 |
+
tags:
|
| 8 |
+
- multimodal
|
| 9 |
+
- moe
|
| 10 |
+
- agent
|
| 11 |
+
- coding
|
| 12 |
+
- video
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
<div align="center">
|
| 16 |
+
<img width="60%" src="figures/logo.svg" alt="MiniMax">
|
| 17 |
+
</div>
|
| 18 |
+
<hr>
|
| 19 |
+
|
| 20 |
+
<p align="center">
|
| 21 |
+
<a href="https://agent.minimax.io/" target="_blank"><img src="https://img.shields.io/badge/MiniMax%20Agent-FF6C37?style=for-the-badge&logo=minimax&logoColor=white" alt="MiniMax Agent"></a>
|
| 22 |
+
<a href="https://platform.minimax.io/docs/guides/text-generation" target="_blank"><img src="https://img.shields.io/badge/API-FF6C37?style=for-the-badge&logo=minimax&logoColor=white" alt="API"></a>
|
| 23 |
+
<a href="https://www.minimax.io" target="_blank"><img src="https://img.shields.io/badge/MiniMax%20Website-FF6C37?style=for-the-badge&logo=minimax&logoColor=white" alt="MiniMax Website"></a>
|
| 24 |
+
<br>
|
| 25 |
+
<a href="https://platform.minimaxi.com/docs/faq/contact-us" target="_blank"><img src="https://img.shields.io/badge/WeChat-07C160?style=for-the-badge&logo=wechat&logoColor=white" alt="WeChat"></a>
|
| 26 |
+
<a href="https://discord.com/invite/DPC4AHFCBw" target="_blank"><img src="https://img.shields.io/badge/Discord-5865F2?style=for-the-badge&logo=discord&logoColor=white" alt="Discord"></a>
|
| 27 |
+
<a href="https://huggingface.co/MiniMaxAI" target="_blank"><img src="https://img.shields.io/badge/Hugging%20Face-FFD21E?style=for-the-badge&logo=huggingface&logoColor=black" alt="Hugging Face"></a>
|
| 28 |
+
<a href="https://github.com/MiniMax-AI/MiniMax-M3" target="_blank"><img src="https://img.shields.io/badge/GitHub-181717?style=for-the-badge&logo=github&logoColor=white" alt="GitHub"></a>
|
| 29 |
+
<a href="https://arxiv.org/abs/2606.13392" target="_blank"><img src="https://img.shields.io/badge/arXiv-2606.13392-B31B1B?style=for-the-badge&logo=arxiv&logoColor=white" alt="arXiv Paper"></a>
|
| 30 |
+
<a href="https://huggingface.co/MiniMaxAI/MiniMax-M3/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/badge/LICENSE-4CAF50?style=for-the-badge&logo=creativecommons&logoColor=white" alt="LICENSE"></a>
|
| 31 |
+
</p>
|
| 32 |
+
|
| 33 |
+
MiniMax-M3 is a native multimodal model with 1M context. It has ~428B parameters and ~23B activated parameters.
|
| 34 |
+
|
| 35 |
+
**Highlights:**
|
| 36 |
+
- **Native Multimodality:** M3 undergoes mixed-modality training from the very first step, enabling deeper semantic fusion across text, image, and video.
|
| 37 |
+
- **Context Scaling via Sparse Attention:** M3 introduces MiniMax Sparse Attention (MSA) to improve long context efficiency. M3 delivers 9× prefill and 15× decode speedups compared to M2 at 1M context, reducing per-token compute to 1/20.
|
| 38 |
+
- **Coding & Cowork Capability:** M3 achieves frontier-level performance across long-horizon agentic benchmarks, excelling in both coding and cowork.
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
<p align="center">
|
| 42 |
+
<img width="100%" src="figures/benchmark.jpeg">
|
| 43 |
+
</p>
|
| 44 |
+
|
| 45 |
+
## MiniMax Sparse Attention (MSA)
|
| 46 |
+
|
| 47 |
+
M3 is powered by [**MiniMax Sparse Attention (MSA)**](https://github.com/MiniMax-AI/MSA), a high-performance sparse attention operator designed for million-token contexts. Compared with GQA, MSA dramatically reduces the attention compute and memory footprint while preserving model quality.
|
| 48 |
+
|
| 49 |
+
<p align="center">
|
| 50 |
+
<img width="100%" src="figures/efficiency_gqa_vs_msa.png" alt="GQA vs MSA Efficiency Comparison">
|
| 51 |
+
</p>
|
| 52 |
+
|
| 53 |
+
> 📄 Read the technical report: [arXiv:2606.13392](https://arxiv.org/abs/2606.13392) · [Hugging Face Papers](https://huggingface.co/papers/2606.13392)
|
| 54 |
+
|
| 55 |
+
## How to Use
|
| 56 |
+
|
| 57 |
+
- [MiniMax Agent](https://agent.minimax.io/)
|
| 58 |
+
- [MiniMax API](https://platform.minimax.io/)
|
| 59 |
+
|
| 60 |
+
M3 supports two reasoning modes:
|
| 61 |
+
- **thinking** — for complex reasoning, agentic tasks, and long-horizon collaboration.
|
| 62 |
+
- **non-thinking** — for latency-sensitive scenarios such as chat and code completion.
|
| 63 |
+
|
| 64 |
+
## Local Deployment
|
| 65 |
+
|
| 66 |
+
Download the model:
|
| 67 |
+
|
| 68 |
+
```bash
|
| 69 |
+
hf download MiniMaxAI/MiniMax-M3 --local-dir MiniMax-M3
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
We recommend the following inference frameworks (listed alphabetically) to serve the model:
|
| 73 |
+
|
| 74 |
+
- [SGLang](https://docs.sglang.io/) - see [SGLang cookbook](https://docs.sglang.io/cookbook/autoregressive/MiniMax/MiniMax-M3).
|
| 75 |
+
|
| 76 |
+
- [vLLM](https://github.com/vllm-project/vllm) - see [vLLM recipes](https://recipes.vllm.ai/MiniMaxAI/MiniMax-M3).
|
| 77 |
+
|
| 78 |
+
- [Transformers](https://github.com/huggingface/transformers) - see [Transformers docs](https://huggingface.co/docs/transformers/model_doc/minimax_m3_vl).
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
### Inference Parameters
|
| 82 |
+
|
| 83 |
+
We recommend the following parameters for best performance: `temperature=1.0`, `top_p=0.95`, `top_k=40`.
|
| 84 |
+
|
| 85 |
+
## Contact Us
|
| 86 |
+
|
| 87 |
+
Contact us at [model@minimax.io](mailto:model@minimax.io).
|
added_tokens.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"]!p~[": 200000,
|
| 3 |
+
"<fim_prefix>": 200001,
|
| 4 |
+
"<fim_middle>": 200002,
|
| 5 |
+
"<fim_suffix>": 200003,
|
| 6 |
+
"<fim_pad>": 200004,
|
| 7 |
+
"<reponame>": 200005,
|
| 8 |
+
"<filename>": 200006,
|
| 9 |
+
"<gh_stars>": 200007,
|
| 10 |
+
"<issue_start>": 200008,
|
| 11 |
+
"<issue_comment>": 200009,
|
| 12 |
+
"<issue_closed>": 200010,
|
| 13 |
+
"<jupyter_start>": 200011,
|
| 14 |
+
"<jupyter_text>": 200012,
|
| 15 |
+
"<jupyter_code>": 200013,
|
| 16 |
+
"<jupyter_output>": 200014,
|
| 17 |
+
"<empty_output>": 200015,
|
| 18 |
+
"<commit_before>": 200016,
|
| 19 |
+
"<commit_msg>": 200017,
|
| 20 |
+
"<commit_after>": 200018,
|
| 21 |
+
"]~b]": 200019,
|
| 22 |
+
"[e~[": 200020,
|
| 23 |
+
"]!d~[": 200021,
|
| 24 |
+
"<function_call>": 200022,
|
| 25 |
+
"<code_interpreter>": 200023,
|
| 26 |
+
"]<]speech[>[": 200024,
|
| 27 |
+
"]<]image[>[": 200025,
|
| 28 |
+
"]<]video[>[": 200026,
|
| 29 |
+
"]<]start of speech[>[": 200027,
|
| 30 |
+
"]<]end of speech[>[": 200028,
|
| 31 |
+
"]<]start of image[>[": 200029,
|
| 32 |
+
"]<]end of image[>[": 200030,
|
| 33 |
+
"]<]start of video[>[": 200031,
|
| 34 |
+
"]<]end of video[>[": 200032,
|
| 35 |
+
"]<]vision pad[>[": 200033,
|
| 36 |
+
"]~!b[": 200034,
|
| 37 |
+
"<jupyter_error>": 200035,
|
| 38 |
+
"<add_file>": 200036,
|
| 39 |
+
"<delete_file>": 200037,
|
| 40 |
+
"<rename_file>": 200038,
|
| 41 |
+
"<edit_file>": 200039,
|
| 42 |
+
"<commit_message>": 200040,
|
| 43 |
+
"<empty_source_file>": 200041,
|
| 44 |
+
"<repo_struct>": 200042,
|
| 45 |
+
"<code_context>": 200043,
|
| 46 |
+
"<file_content>": 200044,
|
| 47 |
+
"<source_files>": 200045,
|
| 48 |
+
"<pr_start>": 200046,
|
| 49 |
+
"<review_comment>": 200047,
|
| 50 |
+
"<filepath>": 200048,
|
| 51 |
+
"<file_sep>": 200049,
|
| 52 |
+
"<think>": 200050,
|
| 53 |
+
"</think>": 200051,
|
| 54 |
+
"<tool_call>": 200052,
|
| 55 |
+
"</tool_call>": 200053,
|
| 56 |
+
"]<]frame[>[": 200054,
|
| 57 |
+
"]<]start of frame[>[": 200055,
|
| 58 |
+
"]<]end of frame[>[": 200056,
|
| 59 |
+
"<|content_altered_placeholder|>": 200057,
|
| 60 |
+
"]<]minimax[>[": 200058,
|
| 61 |
+
"<mm:think>": 200059,
|
| 62 |
+
"</mm:think>": 200060
|
| 63 |
+
}
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{# ---------- special token variables ---------- #}
|
| 2 |
+
{%- set ns_token = ']<]minimax[>[' -%}
|
| 3 |
+
{%- set bod_token = ']~!b[' -%}
|
| 4 |
+
{%- set bos_token = ']~b]' -%}
|
| 5 |
+
{%- set eos_token = '[e~[' -%}
|
| 6 |
+
{%- set toolcall_begin_token = ns_token ~ '<tool_call>' -%}
|
| 7 |
+
{%- set toolcall_end_token = ns_token ~ '</tool_call>' -%}
|
| 8 |
+
{%- set think_begin_token = '<mm:think>' -%}
|
| 9 |
+
{%- set think_end_token = '</mm:think>' -%}
|
| 10 |
+
{%- set image_token = ']<]image[>[' -%}
|
| 11 |
+
{%- set video_token = ']<]video[>[' -%}
|
| 12 |
+
{#- Thinking mode: "enabled" / "disabled" / "adaptive" / not defined -#}
|
| 13 |
+
{#- Recursive XML renderer for tool_call arguments ======================== -#}
|
| 14 |
+
{#- None values are intentionally skipped in mapping iteration so that
|
| 15 |
+
`<key>null</key>` (which would round-trip to the literal string "null")
|
| 16 |
+
never appears in the rendered tool_call. The convention is: omit the
|
| 17 |
+
field entirely. The top-level `_args` loop applies the same rule.
|
| 18 |
+
The `val is none` branch below is a safety net only — upstream cleaning
|
| 19 |
+
(drop_none_in_tool_arguments) should ensure no None ever reaches here. -#}
|
| 20 |
+
{%- macro to_xml(val, ns) -%}
|
| 21 |
+
{%- if val is mapping -%}
|
| 22 |
+
{%- for k, v in val.items() if v is not none -%}
|
| 23 |
+
{{ ns }}<{{ k }}>{{ to_xml(v, ns) }}{{ ns }}</{{ k }}>
|
| 24 |
+
{%- endfor -%}
|
| 25 |
+
{%- elif val is iterable and val is not string -%}
|
| 26 |
+
{%- for item in val -%}
|
| 27 |
+
{{ ns }}<item>{{ to_xml(item, ns) }}{{ ns }}</item>
|
| 28 |
+
{%- endfor -%}
|
| 29 |
+
{%- elif val is none -%}
|
| 30 |
+
{#- Should be unreachable when upstream cleaning is applied. -#}
|
| 31 |
+
{%- elif val is boolean -%}
|
| 32 |
+
{{ val | tojson }}
|
| 33 |
+
{%- else -%}
|
| 34 |
+
{{ val }}
|
| 35 |
+
{%- endif -%}
|
| 36 |
+
{%- endmacro -%}
|
| 37 |
+
{#- Tool Rendering Functions ============================================== -#}
|
| 38 |
+
{%- macro render_tool_namespace(namespace_name, tool_list) -%}
|
| 39 |
+
{%- for tool in tool_list -%}
|
| 40 |
+
<tool>{{ tool.function | tojson(ensure_ascii=False) }}</tool>
|
| 41 |
+
{% endfor -%}
|
| 42 |
+
{%- endmacro -%}
|
| 43 |
+
{%- macro visible_text(content) -%}
|
| 44 |
+
{%- if content is string -%}
|
| 45 |
+
{{ content }}
|
| 46 |
+
{%- elif content is iterable and content is not mapping -%}
|
| 47 |
+
{%- for item in content -%}
|
| 48 |
+
{%- if item is mapping and item.type == 'text' -%}
|
| 49 |
+
{{- item.text }}
|
| 50 |
+
{%- elif item is mapping and item.type == 'image' -%}
|
| 51 |
+
{{- image_token }}
|
| 52 |
+
{%- elif item is mapping and item.type == 'video' -%}
|
| 53 |
+
{{- video_token}}
|
| 54 |
+
{%- elif item is string -%}
|
| 55 |
+
{{- item }}
|
| 56 |
+
{%- endif -%}
|
| 57 |
+
{%- endfor -%}
|
| 58 |
+
{%- elif content is none -%}
|
| 59 |
+
{{- '' }}
|
| 60 |
+
{%- else -%}
|
| 61 |
+
{{- content }}
|
| 62 |
+
{%- endif -%}
|
| 63 |
+
{%- endmacro -%}
|
| 64 |
+
{#- System Message Construction ============================================ -#}
|
| 65 |
+
{%- macro build_system_message(system_message) -%}
|
| 66 |
+
{%- if system_message and system_message.content -%}
|
| 67 |
+
{{- visible_text(system_message.content) }}
|
| 68 |
+
{%- else -%}
|
| 69 |
+
{{- 'Your model version is MiniMax-M3, developed by MiniMax. Knowledge cutoff: January 2026. Founded in early 2022, MiniMax is a global AI foundation model company committed to advancing the frontiers of AI towards AGI.' }}
|
| 70 |
+
{%- endif -%}
|
| 71 |
+
|
| 72 |
+
{#- Thinking mode instructions -#}
|
| 73 |
+
{{- '\n\n<thinking_instructions>\n' }}
|
| 74 |
+
{{- 'You have a thinking capability that allows you to reason step by step before responding. When thinking is enabled, wrap your reasoning in ' ~ think_begin_token ~ think_end_token ~ ' tags before your response. When thinking is disabled, begin your response directly after the ' ~ think_end_token ~ ' prefix. When thinking is adaptive, decide on your own whether to think for the current turn.\n' }}
|
| 75 |
+
{%- if thinking_mode is defined -%}
|
| 76 |
+
{%- if thinking_mode == "enabled" -%}
|
| 77 |
+
{{- 'Current thinking mode: enabled. You MUST think step by step before every response, including after receiving function/tool results.\n' }}
|
| 78 |
+
{%- elif thinking_mode == "disabled" -%}
|
| 79 |
+
{{- 'Current thinking mode: disabled. Do not output any thinking process.\n' }}
|
| 80 |
+
{%- elif thinking_mode == "adaptive" -%}
|
| 81 |
+
{{- 'Current thinking mode: adaptive. You are encouraged to think for complex decision-making, multi-step reasoning, or when analyzing function/tool results.\n' }}
|
| 82 |
+
{%- endif -%}
|
| 83 |
+
{%- else -%}
|
| 84 |
+
{{- 'Current thinking mode: adaptive. You are encouraged to think for complex decision-making, multi-step reasoning, or when analyzing function/tool results.\n' }}
|
| 85 |
+
{%- endif -%}
|
| 86 |
+
{{- '</thinking_instructions>' }}
|
| 87 |
+
{%- endmacro -%}
|
| 88 |
+
{%- macro build_developer_message(developer_message) -%}
|
| 89 |
+
{%- if developer_message and developer_message.content -%}
|
| 90 |
+
{{- visible_text(developer_message.content) }}
|
| 91 |
+
{%- else -%}
|
| 92 |
+
{%- if model_identity is not defined -%}
|
| 93 |
+
{%- set model_identity = "You are a helpful assistant." -%}
|
| 94 |
+
{%- endif -%}
|
| 95 |
+
{{- model_identity }}
|
| 96 |
+
{%- endif -%}
|
| 97 |
+
{%- endmacro -%}
|
| 98 |
+
{#- Main Template Logic ================================================= -#}
|
| 99 |
+
{#- Role mapping: root -> system sp (high priority), system/developer -> developer sp (low priority) -#}
|
| 100 |
+
{%- set system_message = none -%}
|
| 101 |
+
{%- set developer_message = none -%}
|
| 102 |
+
{%- set conversation_messages = messages -%}
|
| 103 |
+
{%- if messages and messages[0].role == "root" -%}
|
| 104 |
+
{%- set system_message = messages[0] -%}
|
| 105 |
+
{%- set conversation_messages = messages[1:] -%}
|
| 106 |
+
{%- if conversation_messages and conversation_messages[0].role in ["system", "developer"] -%}
|
| 107 |
+
{%- set developer_message = conversation_messages[0] -%}
|
| 108 |
+
{%- set conversation_messages = conversation_messages[1:] -%}
|
| 109 |
+
{%- endif -%}
|
| 110 |
+
{%- elif messages and messages[0].role in ["system", "developer"] -%}
|
| 111 |
+
{%- set developer_message = messages[0] -%}
|
| 112 |
+
{%- set conversation_messages = messages[1:] -%}
|
| 113 |
+
{%- endif -%}
|
| 114 |
+
{#- Render system sp (higher priority, root role only) -#}
|
| 115 |
+
{{- bod_token ~ bos_token ~ 'system' ~ '\n' }}
|
| 116 |
+
{{- build_system_message(system_message) }}
|
| 117 |
+
{{- eos_token ~ '\n' }}
|
| 118 |
+
|
| 119 |
+
{#- Render developer sp (lower priority: system/developer role + tools) -#}
|
| 120 |
+
{{- bos_token ~ 'developer' ~ '\n' }}
|
| 121 |
+
{{- build_developer_message(developer_message) }}
|
| 122 |
+
{%- if tools -%}
|
| 123 |
+
{{- '\n\n' ~ '# Tools' ~ '\n' ~ 'You may call one or more tools to assist with the user query.\nHere are the tools available in JSONSchema format:' ~ '\n' }}
|
| 124 |
+
{{- '\n' ~ '<tools>' ~ '\n' }}
|
| 125 |
+
{{- render_tool_namespace("functions", tools) }}
|
| 126 |
+
{{- '</tools>' ~ '\n\n' }}
|
| 127 |
+
{{- 'To call tools, wrap all invocations in a single ' ~ toolcall_begin_token ~ toolcall_end_token ~ ' block. Parameter values containing nested objects or arrays are recursively expanded into XML elements. Example:\n' }}
|
| 128 |
+
{{- '\n' ~ toolcall_begin_token ~ '\n' }}
|
| 129 |
+
{{- ns_token + '<invoke name="tool-name-1">' }}
|
| 130 |
+
{{- ns_token + '<param-1>value-1' + ns_token + '</param-1>' }}
|
| 131 |
+
{{- ns_token + '<param-2>' }}
|
| 132 |
+
{{- ns_token + '<item>' }}
|
| 133 |
+
{{- ns_token + '<key-a>val-a' + ns_token + '</key-a>' }}
|
| 134 |
+
{{- ns_token + '<key-b>val-b' + ns_token + '</key-b>' }}
|
| 135 |
+
{{- ns_token + '</item>' }}
|
| 136 |
+
{{- ns_token + '</param-2>' }}
|
| 137 |
+
{{- ns_token + '</invoke>\n' }}
|
| 138 |
+
{{- ns_token + '<invoke name="tool-name-2">' }}
|
| 139 |
+
{{- ns_token + '<param-1>value-1' + ns_token + '</param-1>' }}
|
| 140 |
+
{{- ns_token + '</invoke>\n' }}
|
| 141 |
+
{{- toolcall_end_token }}
|
| 142 |
+
{%- endif -%}
|
| 143 |
+
{{- eos_token ~ '\n' }}
|
| 144 |
+
|
| 145 |
+
{#- Render messages -#}
|
| 146 |
+
{%- set last_tool_call = namespace(name=none) -%}
|
| 147 |
+
{%- for message in conversation_messages -%}
|
| 148 |
+
{%- if message.role == 'assistant' -%}
|
| 149 |
+
{{- bos_token ~ 'ai' ~ '\n' }}
|
| 150 |
+
|
| 151 |
+
{%- set reasoning_content = '' %}
|
| 152 |
+
{%- set content = visible_text(message.content) %}
|
| 153 |
+
{%- if message.reasoning_content is string %}
|
| 154 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 155 |
+
{%- else %}
|
| 156 |
+
{%- if think_end_token in content %}
|
| 157 |
+
{%- set reasoning_content = content.split(think_end_token)[0].strip('\n').split(think_begin_token)[-1].strip('\n') %}
|
| 158 |
+
{%- set content = content.split(think_end_token)[-1].strip('\n') %}
|
| 159 |
+
{%- endif %}
|
| 160 |
+
{%- endif %}
|
| 161 |
+
|
| 162 |
+
{%- if reasoning_content -%}
|
| 163 |
+
{#- Render thinking for every assistant turn (all-turn visible) -#}
|
| 164 |
+
{{- think_begin_token ~ reasoning_content ~ think_end_token }}
|
| 165 |
+
{%- else -%}
|
| 166 |
+
{#- No thinking rendered → prefix with think_end_token -#}
|
| 167 |
+
{{- think_end_token }}
|
| 168 |
+
{%- endif -%}
|
| 169 |
+
|
| 170 |
+
{%- if content -%}
|
| 171 |
+
{{- content }}
|
| 172 |
+
{%- endif -%}
|
| 173 |
+
{%- if message.tool_calls -%}
|
| 174 |
+
{{- toolcall_begin_token ~ '\n' }}
|
| 175 |
+
|
| 176 |
+
{%- for tool_call in message.tool_calls -%}
|
| 177 |
+
{%- if tool_call.function -%}
|
| 178 |
+
{%- set tool_call = tool_call.function -%}
|
| 179 |
+
{%- endif -%}
|
| 180 |
+
{{- ns_token + '<invoke name="' + tool_call.name + '">' }}
|
| 181 |
+
{%- set _args = tool_call.arguments -%}
|
| 182 |
+
{%- for k, v in _args.items() if v is not none %}
|
| 183 |
+
{{- ns_token + '<' + k + '>' -}}
|
| 184 |
+
{{- to_xml(v, ns_token) -}}
|
| 185 |
+
{{- ns_token + '</' + k + '>' }}
|
| 186 |
+
{%- endfor -%}
|
| 187 |
+
{{- ns_token + '</invoke>' ~ '\n' }}
|
| 188 |
+
{%- endfor -%}
|
| 189 |
+
|
| 190 |
+
{{- toolcall_end_token }}
|
| 191 |
+
{%- if message.tool_calls[-1].function -%}
|
| 192 |
+
{%- set last_tool_call.name = message.tool_calls[-1].function.name -%}
|
| 193 |
+
{%- else -%}
|
| 194 |
+
{%- set last_tool_call.name = message.tool_calls[-1].name -%}
|
| 195 |
+
{%- endif -%}
|
| 196 |
+
{%- else -%}
|
| 197 |
+
{%- set last_tool_call.name = none -%}
|
| 198 |
+
{%- endif -%}
|
| 199 |
+
{{- eos_token ~ '\n' }}
|
| 200 |
+
|
| 201 |
+
{%- elif message.role == 'tool' -%}
|
| 202 |
+
{%- if last_tool_call.name is none -%}
|
| 203 |
+
{{- raise_exception("Message has tool role, but there was no previous assistant message with a tool call!") }}
|
| 204 |
+
{%- endif -%}
|
| 205 |
+
{%- if loop.first or (conversation_messages[loop.index0 - 1].role != 'tool') -%}
|
| 206 |
+
{{- bos_token ~ 'tool' }}
|
| 207 |
+
{%- endif -%}
|
| 208 |
+
{{- '\n<response>' }}
|
| 209 |
+
{%- if message.content is string -%}
|
| 210 |
+
{{- message.content }}
|
| 211 |
+
{%- else -%}
|
| 212 |
+
{%- for tr in message.content -%}
|
| 213 |
+
{%- if tr is mapping and tr.type is defined and tr.type == 'image' -%}
|
| 214 |
+
{{- image_token }}
|
| 215 |
+
{%- elif tr is mapping and tr.type is defined and tr.type == 'video' -%}
|
| 216 |
+
{{- video_token }}
|
| 217 |
+
{%- else -%}
|
| 218 |
+
{{- tr.output if tr.output is defined else (tr.text if tr.type == 'text' and tr.text is defined else tr) }}
|
| 219 |
+
{%- endif -%}
|
| 220 |
+
{%- endfor -%}
|
| 221 |
+
{%- endif -%}
|
| 222 |
+
{{- '</response>' }}
|
| 223 |
+
{%- if loop.last or (conversation_messages[loop.index0 + 1].role != 'tool') -%}
|
| 224 |
+
{{- eos_token ~ '\n' -}}
|
| 225 |
+
{%- endif -%}
|
| 226 |
+
|
| 227 |
+
{%- elif message.role == 'user' -%}
|
| 228 |
+
{{- bos_token ~ 'user' ~ '\n' }}
|
| 229 |
+
{{- visible_text(message.content) }}
|
| 230 |
+
{{- eos_token ~ '\n' }}
|
| 231 |
+
{%- endif -%}
|
| 232 |
+
{%- endfor -%}
|
| 233 |
+
|
| 234 |
+
{#- Generation prompt -#}
|
| 235 |
+
{%- if add_generation_prompt -%}
|
| 236 |
+
{{- bos_token ~ 'ai' ~ '\n' }}
|
| 237 |
+
{%- if thinking_mode is defined and thinking_mode == "disabled" -%}
|
| 238 |
+
{{- think_end_token }}
|
| 239 |
+
{%- elif thinking_mode is defined and thinking_mode == "adaptive" -%}
|
| 240 |
+
{#- adaptive: no prefix, let model decide -#}
|
| 241 |
+
{%- elif thinking_mode is defined and thinking_mode == "enabled" -%}
|
| 242 |
+
{#- enabled or not defined: default to think -#}
|
| 243 |
+
{{- think_begin_token }}
|
| 244 |
+
{%- else -%}
|
| 245 |
+
{#- adaptive: no prefix, let model decide -#}
|
| 246 |
+
{%- endif -%}
|
| 247 |
+
{%- endif -%}
|
config.json
ADDED
|
@@ -0,0 +1,1317 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"MiniMaxM3SparseForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"auto_map": {
|
| 6 |
+
"AutoConfig": "configuration_minimax_m3_vl.MiniMaxM3VLConfig"
|
| 7 |
+
},
|
| 8 |
+
"model_type": "minimax_m3_vl",
|
| 9 |
+
"text_config": {
|
| 10 |
+
"hidden_size": 6144,
|
| 11 |
+
"intermediate_size": 3072,
|
| 12 |
+
"num_hidden_layers": 60,
|
| 13 |
+
"num_attention_heads": 64,
|
| 14 |
+
"num_key_value_heads": 4,
|
| 15 |
+
"head_dim": 128,
|
| 16 |
+
"vocab_size": 200064,
|
| 17 |
+
"max_position_embeddings": 1048576,
|
| 18 |
+
"rms_norm_eps": 1e-06,
|
| 19 |
+
"use_gemma_norm": true,
|
| 20 |
+
"attention_output_gate": false,
|
| 21 |
+
"rope_theta": 5000000,
|
| 22 |
+
"rotary_dim": 64,
|
| 23 |
+
"partial_rotary_factor": 0.5,
|
| 24 |
+
"hidden_act": "swigluoai",
|
| 25 |
+
"use_qk_norm": true,
|
| 26 |
+
"tie_word_embeddings": false,
|
| 27 |
+
"dense_intermediate_size": 12288,
|
| 28 |
+
"shared_intermediate_size": 3072,
|
| 29 |
+
"num_local_experts": 128,
|
| 30 |
+
"num_experts_per_tok": 4,
|
| 31 |
+
"n_shared_experts": 1,
|
| 32 |
+
"scoring_func": "sigmoid",
|
| 33 |
+
"use_routing_bias": true,
|
| 34 |
+
"moe_layer_freq": [
|
| 35 |
+
0,
|
| 36 |
+
0,
|
| 37 |
+
0,
|
| 38 |
+
1,
|
| 39 |
+
1,
|
| 40 |
+
1,
|
| 41 |
+
1,
|
| 42 |
+
1,
|
| 43 |
+
1,
|
| 44 |
+
1,
|
| 45 |
+
1,
|
| 46 |
+
1,
|
| 47 |
+
1,
|
| 48 |
+
1,
|
| 49 |
+
1,
|
| 50 |
+
1,
|
| 51 |
+
1,
|
| 52 |
+
1,
|
| 53 |
+
1,
|
| 54 |
+
1,
|
| 55 |
+
1,
|
| 56 |
+
1,
|
| 57 |
+
1,
|
| 58 |
+
1,
|
| 59 |
+
1,
|
| 60 |
+
1,
|
| 61 |
+
1,
|
| 62 |
+
1,
|
| 63 |
+
1,
|
| 64 |
+
1,
|
| 65 |
+
1,
|
| 66 |
+
1,
|
| 67 |
+
1,
|
| 68 |
+
1,
|
| 69 |
+
1,
|
| 70 |
+
1,
|
| 71 |
+
1,
|
| 72 |
+
1,
|
| 73 |
+
1,
|
| 74 |
+
1,
|
| 75 |
+
1,
|
| 76 |
+
1,
|
| 77 |
+
1,
|
| 78 |
+
1,
|
| 79 |
+
1,
|
| 80 |
+
1,
|
| 81 |
+
1,
|
| 82 |
+
1,
|
| 83 |
+
1,
|
| 84 |
+
1,
|
| 85 |
+
1,
|
| 86 |
+
1,
|
| 87 |
+
1,
|
| 88 |
+
1,
|
| 89 |
+
1,
|
| 90 |
+
1,
|
| 91 |
+
1,
|
| 92 |
+
1,
|
| 93 |
+
1,
|
| 94 |
+
1
|
| 95 |
+
],
|
| 96 |
+
"qk_norm_type": "per_head",
|
| 97 |
+
"num_mtp_modules": 7,
|
| 98 |
+
"num_nextn_predict_layers": 1,
|
| 99 |
+
"swiglu_alpha": 1.702,
|
| 100 |
+
"swiglu_limit": 7.0,
|
| 101 |
+
"routed_scaling_factor": 2.0,
|
| 102 |
+
"sparse_attention_config": {
|
| 103 |
+
"use_sparse_attention": true,
|
| 104 |
+
"sparse_index_dim": 128,
|
| 105 |
+
"sparse_num_index_heads": 4,
|
| 106 |
+
"sparse_topk_blocks": 16,
|
| 107 |
+
"sparse_block_size": 128,
|
| 108 |
+
"sparse_disable_index_value": [
|
| 109 |
+
0,
|
| 110 |
+
0,
|
| 111 |
+
0,
|
| 112 |
+
1,
|
| 113 |
+
1,
|
| 114 |
+
1,
|
| 115 |
+
1,
|
| 116 |
+
1,
|
| 117 |
+
1,
|
| 118 |
+
1,
|
| 119 |
+
1,
|
| 120 |
+
1,
|
| 121 |
+
1,
|
| 122 |
+
1,
|
| 123 |
+
1,
|
| 124 |
+
1,
|
| 125 |
+
1,
|
| 126 |
+
1,
|
| 127 |
+
1,
|
| 128 |
+
1,
|
| 129 |
+
1,
|
| 130 |
+
1,
|
| 131 |
+
1,
|
| 132 |
+
1,
|
| 133 |
+
1,
|
| 134 |
+
1,
|
| 135 |
+
1,
|
| 136 |
+
1,
|
| 137 |
+
1,
|
| 138 |
+
1,
|
| 139 |
+
1,
|
| 140 |
+
1,
|
| 141 |
+
1,
|
| 142 |
+
1,
|
| 143 |
+
1,
|
| 144 |
+
1,
|
| 145 |
+
1,
|
| 146 |
+
1,
|
| 147 |
+
1,
|
| 148 |
+
1,
|
| 149 |
+
1,
|
| 150 |
+
1,
|
| 151 |
+
1,
|
| 152 |
+
1,
|
| 153 |
+
1,
|
| 154 |
+
1,
|
| 155 |
+
1,
|
| 156 |
+
1,
|
| 157 |
+
1,
|
| 158 |
+
1,
|
| 159 |
+
1,
|
| 160 |
+
1,
|
| 161 |
+
1,
|
| 162 |
+
1,
|
| 163 |
+
1,
|
| 164 |
+
1,
|
| 165 |
+
1,
|
| 166 |
+
1,
|
| 167 |
+
1,
|
| 168 |
+
1
|
| 169 |
+
],
|
| 170 |
+
"sparse_score_type": "max",
|
| 171 |
+
"sparse_init_block": 0,
|
| 172 |
+
"sparse_local_block": 1,
|
| 173 |
+
"sparse_attention_freq": [
|
| 174 |
+
0,
|
| 175 |
+
0,
|
| 176 |
+
0,
|
| 177 |
+
1,
|
| 178 |
+
1,
|
| 179 |
+
1,
|
| 180 |
+
1,
|
| 181 |
+
1,
|
| 182 |
+
1,
|
| 183 |
+
1,
|
| 184 |
+
1,
|
| 185 |
+
1,
|
| 186 |
+
1,
|
| 187 |
+
1,
|
| 188 |
+
1,
|
| 189 |
+
1,
|
| 190 |
+
1,
|
| 191 |
+
1,
|
| 192 |
+
1,
|
| 193 |
+
1,
|
| 194 |
+
1,
|
| 195 |
+
1,
|
| 196 |
+
1,
|
| 197 |
+
1,
|
| 198 |
+
1,
|
| 199 |
+
1,
|
| 200 |
+
1,
|
| 201 |
+
1,
|
| 202 |
+
1,
|
| 203 |
+
1,
|
| 204 |
+
1,
|
| 205 |
+
1,
|
| 206 |
+
1,
|
| 207 |
+
1,
|
| 208 |
+
1,
|
| 209 |
+
1,
|
| 210 |
+
1,
|
| 211 |
+
1,
|
| 212 |
+
1,
|
| 213 |
+
1,
|
| 214 |
+
1,
|
| 215 |
+
1,
|
| 216 |
+
1,
|
| 217 |
+
1,
|
| 218 |
+
1,
|
| 219 |
+
1,
|
| 220 |
+
1,
|
| 221 |
+
1,
|
| 222 |
+
1,
|
| 223 |
+
1,
|
| 224 |
+
1,
|
| 225 |
+
1,
|
| 226 |
+
1,
|
| 227 |
+
1,
|
| 228 |
+
1,
|
| 229 |
+
1,
|
| 230 |
+
1,
|
| 231 |
+
1,
|
| 232 |
+
1,
|
| 233 |
+
1
|
| 234 |
+
]
|
| 235 |
+
},
|
| 236 |
+
"architectures": [
|
| 237 |
+
"MiniMaxM3SparseForCausalLM"
|
| 238 |
+
]
|
| 239 |
+
},
|
| 240 |
+
"vision_config": {
|
| 241 |
+
"hidden_size": 1280,
|
| 242 |
+
"num_attention_heads": 16,
|
| 243 |
+
"num_hidden_layers": 32,
|
| 244 |
+
"intermediate_size": 5120,
|
| 245 |
+
"patch_size": 14,
|
| 246 |
+
"image_size": 2016,
|
| 247 |
+
"projection_dim": 6144,
|
| 248 |
+
"position_embedding_type": "rope",
|
| 249 |
+
"rope_mode": "3d",
|
| 250 |
+
"rope_theta": 10000.0,
|
| 251 |
+
"attention_dropout": 0.0,
|
| 252 |
+
"hidden_act": "gelu",
|
| 253 |
+
"initializer_factor": 1.0,
|
| 254 |
+
"initializer_range": 0.02,
|
| 255 |
+
"layer_norm_eps": 1e-05,
|
| 256 |
+
"model_type": "clip_vision_model",
|
| 257 |
+
"num_channels": 3,
|
| 258 |
+
"vocab_size": 32000,
|
| 259 |
+
"img_token_compression_config": {
|
| 260 |
+
"image_token_compression_method": "patch_merge",
|
| 261 |
+
"spatial_merge_size": 2,
|
| 262 |
+
"temporal_patch_size": 2
|
| 263 |
+
},
|
| 264 |
+
"vision_segment_max_frames": 4
|
| 265 |
+
},
|
| 266 |
+
"img_token_compression_config": {
|
| 267 |
+
"image_token_compression_method": "patch_merge",
|
| 268 |
+
"spatial_merge_size": 2,
|
| 269 |
+
"temporal_patch_size": 2
|
| 270 |
+
},
|
| 271 |
+
"image_grid_pinpoints": "[(336, 336), (336, 672), (336, 1008), (336, 1344), (336, 1680), (336, 2016), (672, 336), (672, 672), (672, 1008), (672, 1344), (672, 1680), (672, 2016), (1008, 336), (1008, 672), (1008, 1008), (1008, 1344), (1008, 1680), (1008, 2016), (1344, 336), (1344, 672), (1344, 1008), (1344, 1344), (1344, 1680), (1344, 2016), (1680, 336), (1680, 672), (1680, 1008), (1680, 1344), (1680, 1680), (1680, 2016), (2016, 336), (2016, 672), (2016, 1008), (2016, 1344), (2016, 1680), (2016, 2016)]",
|
| 272 |
+
"image_seq_length": 576,
|
| 273 |
+
"image_token_index": 200025,
|
| 274 |
+
"video_token_index": 200026,
|
| 275 |
+
"multimodal_projector_bias": true,
|
| 276 |
+
"num_reward_heads": 0,
|
| 277 |
+
"process_image_mode": "dynamic_res",
|
| 278 |
+
"projector_hidden_act": "gelu",
|
| 279 |
+
"vision_feature_layer": -1,
|
| 280 |
+
"vision_feature_select_strategy": "full",
|
| 281 |
+
"torch_dtype": "bfloat16",
|
| 282 |
+
"transformers_version": "4.52.4",
|
| 283 |
+
"projector_hidden_size": 6144,
|
| 284 |
+
"quantization_config": {
|
| 285 |
+
"quant_method": "auto-round",
|
| 286 |
+
"packing_format": "auto_round:auto_gptq",
|
| 287 |
+
"bits": 4,
|
| 288 |
+
"group_size": 128,
|
| 289 |
+
"sym": true,
|
| 290 |
+
"data_type": "int",
|
| 291 |
+
"iters": 0,
|
| 292 |
+
"model_free": true,
|
| 293 |
+
"autoround_version": "0.14.0",
|
| 294 |
+
"extra_config": {
|
| 295 |
+
"language_model.lm_head": {
|
| 296 |
+
"bits": 16,
|
| 297 |
+
"data_type": "float"
|
| 298 |
+
},
|
| 299 |
+
"language_model.model.embed_tokens": {
|
| 300 |
+
"bits": 16,
|
| 301 |
+
"data_type": "float"
|
| 302 |
+
},
|
| 303 |
+
"language_model.model.layers.3.block_sparse_moe.gate": {
|
| 304 |
+
"bits": 16,
|
| 305 |
+
"data_type": "float"
|
| 306 |
+
},
|
| 307 |
+
"language_model.model.layers.4.block_sparse_moe.gate": {
|
| 308 |
+
"bits": 16,
|
| 309 |
+
"data_type": "float"
|
| 310 |
+
},
|
| 311 |
+
"language_model.model.layers.5.block_sparse_moe.gate": {
|
| 312 |
+
"bits": 16,
|
| 313 |
+
"data_type": "float"
|
| 314 |
+
},
|
| 315 |
+
"language_model.model.layers.6.block_sparse_moe.gate": {
|
| 316 |
+
"bits": 16,
|
| 317 |
+
"data_type": "float"
|
| 318 |
+
},
|
| 319 |
+
"language_model.model.layers.7.block_sparse_moe.gate": {
|
| 320 |
+
"bits": 16,
|
| 321 |
+
"data_type": "float"
|
| 322 |
+
},
|
| 323 |
+
"language_model.model.layers.8.block_sparse_moe.gate": {
|
| 324 |
+
"bits": 16,
|
| 325 |
+
"data_type": "float"
|
| 326 |
+
},
|
| 327 |
+
"language_model.model.layers.9.block_sparse_moe.gate": {
|
| 328 |
+
"bits": 16,
|
| 329 |
+
"data_type": "float"
|
| 330 |
+
},
|
| 331 |
+
"language_model.model.layers.10.block_sparse_moe.gate": {
|
| 332 |
+
"bits": 16,
|
| 333 |
+
"data_type": "float"
|
| 334 |
+
},
|
| 335 |
+
"language_model.model.layers.11.block_sparse_moe.gate": {
|
| 336 |
+
"bits": 16,
|
| 337 |
+
"data_type": "float"
|
| 338 |
+
},
|
| 339 |
+
"language_model.model.layers.12.block_sparse_moe.gate": {
|
| 340 |
+
"bits": 16,
|
| 341 |
+
"data_type": "float"
|
| 342 |
+
},
|
| 343 |
+
"language_model.model.layers.13.block_sparse_moe.gate": {
|
| 344 |
+
"bits": 16,
|
| 345 |
+
"data_type": "float"
|
| 346 |
+
},
|
| 347 |
+
"language_model.model.layers.14.block_sparse_moe.gate": {
|
| 348 |
+
"bits": 16,
|
| 349 |
+
"data_type": "float"
|
| 350 |
+
},
|
| 351 |
+
"language_model.model.layers.15.block_sparse_moe.gate": {
|
| 352 |
+
"bits": 16,
|
| 353 |
+
"data_type": "float"
|
| 354 |
+
},
|
| 355 |
+
"language_model.model.layers.16.block_sparse_moe.gate": {
|
| 356 |
+
"bits": 16,
|
| 357 |
+
"data_type": "float"
|
| 358 |
+
},
|
| 359 |
+
"language_model.model.layers.17.block_sparse_moe.gate": {
|
| 360 |
+
"bits": 16,
|
| 361 |
+
"data_type": "float"
|
| 362 |
+
},
|
| 363 |
+
"language_model.model.layers.18.block_sparse_moe.gate": {
|
| 364 |
+
"bits": 16,
|
| 365 |
+
"data_type": "float"
|
| 366 |
+
},
|
| 367 |
+
"language_model.model.layers.19.block_sparse_moe.gate": {
|
| 368 |
+
"bits": 16,
|
| 369 |
+
"data_type": "float"
|
| 370 |
+
},
|
| 371 |
+
"language_model.model.layers.20.block_sparse_moe.gate": {
|
| 372 |
+
"bits": 16,
|
| 373 |
+
"data_type": "float"
|
| 374 |
+
},
|
| 375 |
+
"language_model.model.layers.21.block_sparse_moe.gate": {
|
| 376 |
+
"bits": 16,
|
| 377 |
+
"data_type": "float"
|
| 378 |
+
},
|
| 379 |
+
"language_model.model.layers.22.block_sparse_moe.gate": {
|
| 380 |
+
"bits": 16,
|
| 381 |
+
"data_type": "float"
|
| 382 |
+
},
|
| 383 |
+
"language_model.model.layers.23.block_sparse_moe.gate": {
|
| 384 |
+
"bits": 16,
|
| 385 |
+
"data_type": "float"
|
| 386 |
+
},
|
| 387 |
+
"language_model.model.layers.24.block_sparse_moe.gate": {
|
| 388 |
+
"bits": 16,
|
| 389 |
+
"data_type": "float"
|
| 390 |
+
},
|
| 391 |
+
"language_model.model.layers.25.block_sparse_moe.gate": {
|
| 392 |
+
"bits": 16,
|
| 393 |
+
"data_type": "float"
|
| 394 |
+
},
|
| 395 |
+
"language_model.model.layers.26.block_sparse_moe.gate": {
|
| 396 |
+
"bits": 16,
|
| 397 |
+
"data_type": "float"
|
| 398 |
+
},
|
| 399 |
+
"language_model.model.layers.27.block_sparse_moe.gate": {
|
| 400 |
+
"bits": 16,
|
| 401 |
+
"data_type": "float"
|
| 402 |
+
},
|
| 403 |
+
"language_model.model.layers.28.block_sparse_moe.gate": {
|
| 404 |
+
"bits": 16,
|
| 405 |
+
"data_type": "float"
|
| 406 |
+
},
|
| 407 |
+
"language_model.model.layers.29.block_sparse_moe.gate": {
|
| 408 |
+
"bits": 16,
|
| 409 |
+
"data_type": "float"
|
| 410 |
+
},
|
| 411 |
+
"language_model.model.layers.30.block_sparse_moe.gate": {
|
| 412 |
+
"bits": 16,
|
| 413 |
+
"data_type": "float"
|
| 414 |
+
},
|
| 415 |
+
"language_model.model.layers.31.block_sparse_moe.gate": {
|
| 416 |
+
"bits": 16,
|
| 417 |
+
"data_type": "float"
|
| 418 |
+
},
|
| 419 |
+
"language_model.model.layers.32.block_sparse_moe.gate": {
|
| 420 |
+
"bits": 16,
|
| 421 |
+
"data_type": "float"
|
| 422 |
+
},
|
| 423 |
+
"language_model.model.layers.33.block_sparse_moe.gate": {
|
| 424 |
+
"bits": 16,
|
| 425 |
+
"data_type": "float"
|
| 426 |
+
},
|
| 427 |
+
"language_model.model.layers.34.block_sparse_moe.gate": {
|
| 428 |
+
"bits": 16,
|
| 429 |
+
"data_type": "float"
|
| 430 |
+
},
|
| 431 |
+
"language_model.model.layers.35.block_sparse_moe.gate": {
|
| 432 |
+
"bits": 16,
|
| 433 |
+
"data_type": "float"
|
| 434 |
+
},
|
| 435 |
+
"language_model.model.layers.36.block_sparse_moe.gate": {
|
| 436 |
+
"bits": 16,
|
| 437 |
+
"data_type": "float"
|
| 438 |
+
},
|
| 439 |
+
"language_model.model.layers.37.block_sparse_moe.gate": {
|
| 440 |
+
"bits": 16,
|
| 441 |
+
"data_type": "float"
|
| 442 |
+
},
|
| 443 |
+
"language_model.model.layers.38.block_sparse_moe.gate": {
|
| 444 |
+
"bits": 16,
|
| 445 |
+
"data_type": "float"
|
| 446 |
+
},
|
| 447 |
+
"language_model.model.layers.39.block_sparse_moe.gate": {
|
| 448 |
+
"bits": 16,
|
| 449 |
+
"data_type": "float"
|
| 450 |
+
},
|
| 451 |
+
"language_model.model.layers.40.block_sparse_moe.gate": {
|
| 452 |
+
"bits": 16,
|
| 453 |
+
"data_type": "float"
|
| 454 |
+
},
|
| 455 |
+
"language_model.model.layers.41.block_sparse_moe.gate": {
|
| 456 |
+
"bits": 16,
|
| 457 |
+
"data_type": "float"
|
| 458 |
+
},
|
| 459 |
+
"language_model.model.layers.42.block_sparse_moe.gate": {
|
| 460 |
+
"bits": 16,
|
| 461 |
+
"data_type": "float"
|
| 462 |
+
},
|
| 463 |
+
"language_model.model.layers.43.block_sparse_moe.gate": {
|
| 464 |
+
"bits": 16,
|
| 465 |
+
"data_type": "float"
|
| 466 |
+
},
|
| 467 |
+
"language_model.model.layers.44.block_sparse_moe.gate": {
|
| 468 |
+
"bits": 16,
|
| 469 |
+
"data_type": "float"
|
| 470 |
+
},
|
| 471 |
+
"language_model.model.layers.45.block_sparse_moe.gate": {
|
| 472 |
+
"bits": 16,
|
| 473 |
+
"data_type": "float"
|
| 474 |
+
},
|
| 475 |
+
"language_model.model.layers.46.block_sparse_moe.gate": {
|
| 476 |
+
"bits": 16,
|
| 477 |
+
"data_type": "float"
|
| 478 |
+
},
|
| 479 |
+
"language_model.model.layers.47.block_sparse_moe.gate": {
|
| 480 |
+
"bits": 16,
|
| 481 |
+
"data_type": "float"
|
| 482 |
+
},
|
| 483 |
+
"language_model.model.layers.48.block_sparse_moe.gate": {
|
| 484 |
+
"bits": 16,
|
| 485 |
+
"data_type": "float"
|
| 486 |
+
},
|
| 487 |
+
"language_model.model.layers.49.block_sparse_moe.gate": {
|
| 488 |
+
"bits": 16,
|
| 489 |
+
"data_type": "float"
|
| 490 |
+
},
|
| 491 |
+
"language_model.model.layers.50.block_sparse_moe.gate": {
|
| 492 |
+
"bits": 16,
|
| 493 |
+
"data_type": "float"
|
| 494 |
+
},
|
| 495 |
+
"language_model.model.layers.51.block_sparse_moe.gate": {
|
| 496 |
+
"bits": 16,
|
| 497 |
+
"data_type": "float"
|
| 498 |
+
},
|
| 499 |
+
"language_model.model.layers.52.block_sparse_moe.gate": {
|
| 500 |
+
"bits": 16,
|
| 501 |
+
"data_type": "float"
|
| 502 |
+
},
|
| 503 |
+
"language_model.model.layers.53.block_sparse_moe.gate": {
|
| 504 |
+
"bits": 16,
|
| 505 |
+
"data_type": "float"
|
| 506 |
+
},
|
| 507 |
+
"language_model.model.layers.54.block_sparse_moe.gate": {
|
| 508 |
+
"bits": 16,
|
| 509 |
+
"data_type": "float"
|
| 510 |
+
},
|
| 511 |
+
"language_model.model.layers.55.block_sparse_moe.gate": {
|
| 512 |
+
"bits": 16,
|
| 513 |
+
"data_type": "float"
|
| 514 |
+
},
|
| 515 |
+
"language_model.model.layers.56.block_sparse_moe.gate": {
|
| 516 |
+
"bits": 16,
|
| 517 |
+
"data_type": "float"
|
| 518 |
+
},
|
| 519 |
+
"language_model.model.layers.57.block_sparse_moe.gate": {
|
| 520 |
+
"bits": 16,
|
| 521 |
+
"data_type": "float"
|
| 522 |
+
},
|
| 523 |
+
"language_model.model.layers.58.block_sparse_moe.gate": {
|
| 524 |
+
"bits": 16,
|
| 525 |
+
"data_type": "float"
|
| 526 |
+
},
|
| 527 |
+
"language_model.model.layers.59.block_sparse_moe.gate": {
|
| 528 |
+
"bits": 16,
|
| 529 |
+
"data_type": "float"
|
| 530 |
+
},
|
| 531 |
+
"vision_tower.vision_model.encoder.layers.0.mlp.fc1": {
|
| 532 |
+
"bits": 16,
|
| 533 |
+
"data_type": "float"
|
| 534 |
+
},
|
| 535 |
+
"vision_tower.vision_model.encoder.layers.0.mlp.fc2": {
|
| 536 |
+
"bits": 16,
|
| 537 |
+
"data_type": "float"
|
| 538 |
+
},
|
| 539 |
+
"vision_tower.vision_model.encoder.layers.0.self_attn.k_proj": {
|
| 540 |
+
"bits": 16,
|
| 541 |
+
"data_type": "float"
|
| 542 |
+
},
|
| 543 |
+
"vision_tower.vision_model.encoder.layers.0.self_attn.out_proj": {
|
| 544 |
+
"bits": 16,
|
| 545 |
+
"data_type": "float"
|
| 546 |
+
},
|
| 547 |
+
"vision_tower.vision_model.encoder.layers.0.self_attn.q_proj": {
|
| 548 |
+
"bits": 16,
|
| 549 |
+
"data_type": "float"
|
| 550 |
+
},
|
| 551 |
+
"vision_tower.vision_model.encoder.layers.0.self_attn.v_proj": {
|
| 552 |
+
"bits": 16,
|
| 553 |
+
"data_type": "float"
|
| 554 |
+
},
|
| 555 |
+
"vision_tower.vision_model.encoder.layers.1.mlp.fc1": {
|
| 556 |
+
"bits": 16,
|
| 557 |
+
"data_type": "float"
|
| 558 |
+
},
|
| 559 |
+
"vision_tower.vision_model.encoder.layers.1.mlp.fc2": {
|
| 560 |
+
"bits": 16,
|
| 561 |
+
"data_type": "float"
|
| 562 |
+
},
|
| 563 |
+
"vision_tower.vision_model.encoder.layers.1.self_attn.k_proj": {
|
| 564 |
+
"bits": 16,
|
| 565 |
+
"data_type": "float"
|
| 566 |
+
},
|
| 567 |
+
"vision_tower.vision_model.encoder.layers.1.self_attn.out_proj": {
|
| 568 |
+
"bits": 16,
|
| 569 |
+
"data_type": "float"
|
| 570 |
+
},
|
| 571 |
+
"vision_tower.vision_model.encoder.layers.1.self_attn.q_proj": {
|
| 572 |
+
"bits": 16,
|
| 573 |
+
"data_type": "float"
|
| 574 |
+
},
|
| 575 |
+
"vision_tower.vision_model.encoder.layers.1.self_attn.v_proj": {
|
| 576 |
+
"bits": 16,
|
| 577 |
+
"data_type": "float"
|
| 578 |
+
},
|
| 579 |
+
"vision_tower.vision_model.encoder.layers.10.mlp.fc1": {
|
| 580 |
+
"bits": 16,
|
| 581 |
+
"data_type": "float"
|
| 582 |
+
},
|
| 583 |
+
"vision_tower.vision_model.encoder.layers.10.mlp.fc2": {
|
| 584 |
+
"bits": 16,
|
| 585 |
+
"data_type": "float"
|
| 586 |
+
},
|
| 587 |
+
"vision_tower.vision_model.encoder.layers.10.self_attn.k_proj": {
|
| 588 |
+
"bits": 16,
|
| 589 |
+
"data_type": "float"
|
| 590 |
+
},
|
| 591 |
+
"vision_tower.vision_model.encoder.layers.10.self_attn.out_proj": {
|
| 592 |
+
"bits": 16,
|
| 593 |
+
"data_type": "float"
|
| 594 |
+
},
|
| 595 |
+
"vision_tower.vision_model.encoder.layers.10.self_attn.q_proj": {
|
| 596 |
+
"bits": 16,
|
| 597 |
+
"data_type": "float"
|
| 598 |
+
},
|
| 599 |
+
"vision_tower.vision_model.encoder.layers.10.self_attn.v_proj": {
|
| 600 |
+
"bits": 16,
|
| 601 |
+
"data_type": "float"
|
| 602 |
+
},
|
| 603 |
+
"vision_tower.vision_model.encoder.layers.11.mlp.fc1": {
|
| 604 |
+
"bits": 16,
|
| 605 |
+
"data_type": "float"
|
| 606 |
+
},
|
| 607 |
+
"vision_tower.vision_model.encoder.layers.11.mlp.fc2": {
|
| 608 |
+
"bits": 16,
|
| 609 |
+
"data_type": "float"
|
| 610 |
+
},
|
| 611 |
+
"vision_tower.vision_model.encoder.layers.11.self_attn.k_proj": {
|
| 612 |
+
"bits": 16,
|
| 613 |
+
"data_type": "float"
|
| 614 |
+
},
|
| 615 |
+
"vision_tower.vision_model.encoder.layers.11.self_attn.out_proj": {
|
| 616 |
+
"bits": 16,
|
| 617 |
+
"data_type": "float"
|
| 618 |
+
},
|
| 619 |
+
"vision_tower.vision_model.encoder.layers.11.self_attn.q_proj": {
|
| 620 |
+
"bits": 16,
|
| 621 |
+
"data_type": "float"
|
| 622 |
+
},
|
| 623 |
+
"vision_tower.vision_model.encoder.layers.11.self_attn.v_proj": {
|
| 624 |
+
"bits": 16,
|
| 625 |
+
"data_type": "float"
|
| 626 |
+
},
|
| 627 |
+
"vision_tower.vision_model.encoder.layers.12.mlp.fc1": {
|
| 628 |
+
"bits": 16,
|
| 629 |
+
"data_type": "float"
|
| 630 |
+
},
|
| 631 |
+
"vision_tower.vision_model.encoder.layers.12.mlp.fc2": {
|
| 632 |
+
"bits": 16,
|
| 633 |
+
"data_type": "float"
|
| 634 |
+
},
|
| 635 |
+
"vision_tower.vision_model.encoder.layers.12.self_attn.k_proj": {
|
| 636 |
+
"bits": 16,
|
| 637 |
+
"data_type": "float"
|
| 638 |
+
},
|
| 639 |
+
"vision_tower.vision_model.encoder.layers.12.self_attn.out_proj": {
|
| 640 |
+
"bits": 16,
|
| 641 |
+
"data_type": "float"
|
| 642 |
+
},
|
| 643 |
+
"vision_tower.vision_model.encoder.layers.12.self_attn.q_proj": {
|
| 644 |
+
"bits": 16,
|
| 645 |
+
"data_type": "float"
|
| 646 |
+
},
|
| 647 |
+
"vision_tower.vision_model.encoder.layers.12.self_attn.v_proj": {
|
| 648 |
+
"bits": 16,
|
| 649 |
+
"data_type": "float"
|
| 650 |
+
},
|
| 651 |
+
"vision_tower.vision_model.encoder.layers.13.mlp.fc1": {
|
| 652 |
+
"bits": 16,
|
| 653 |
+
"data_type": "float"
|
| 654 |
+
},
|
| 655 |
+
"vision_tower.vision_model.encoder.layers.13.mlp.fc2": {
|
| 656 |
+
"bits": 16,
|
| 657 |
+
"data_type": "float"
|
| 658 |
+
},
|
| 659 |
+
"vision_tower.vision_model.encoder.layers.13.self_attn.k_proj": {
|
| 660 |
+
"bits": 16,
|
| 661 |
+
"data_type": "float"
|
| 662 |
+
},
|
| 663 |
+
"vision_tower.vision_model.encoder.layers.13.self_attn.out_proj": {
|
| 664 |
+
"bits": 16,
|
| 665 |
+
"data_type": "float"
|
| 666 |
+
},
|
| 667 |
+
"vision_tower.vision_model.encoder.layers.13.self_attn.q_proj": {
|
| 668 |
+
"bits": 16,
|
| 669 |
+
"data_type": "float"
|
| 670 |
+
},
|
| 671 |
+
"vision_tower.vision_model.encoder.layers.13.self_attn.v_proj": {
|
| 672 |
+
"bits": 16,
|
| 673 |
+
"data_type": "float"
|
| 674 |
+
},
|
| 675 |
+
"vision_tower.vision_model.encoder.layers.14.mlp.fc1": {
|
| 676 |
+
"bits": 16,
|
| 677 |
+
"data_type": "float"
|
| 678 |
+
},
|
| 679 |
+
"vision_tower.vision_model.encoder.layers.14.mlp.fc2": {
|
| 680 |
+
"bits": 16,
|
| 681 |
+
"data_type": "float"
|
| 682 |
+
},
|
| 683 |
+
"vision_tower.vision_model.encoder.layers.14.self_attn.k_proj": {
|
| 684 |
+
"bits": 16,
|
| 685 |
+
"data_type": "float"
|
| 686 |
+
},
|
| 687 |
+
"vision_tower.vision_model.encoder.layers.14.self_attn.out_proj": {
|
| 688 |
+
"bits": 16,
|
| 689 |
+
"data_type": "float"
|
| 690 |
+
},
|
| 691 |
+
"vision_tower.vision_model.encoder.layers.14.self_attn.q_proj": {
|
| 692 |
+
"bits": 16,
|
| 693 |
+
"data_type": "float"
|
| 694 |
+
},
|
| 695 |
+
"vision_tower.vision_model.encoder.layers.14.self_attn.v_proj": {
|
| 696 |
+
"bits": 16,
|
| 697 |
+
"data_type": "float"
|
| 698 |
+
},
|
| 699 |
+
"vision_tower.vision_model.encoder.layers.15.mlp.fc1": {
|
| 700 |
+
"bits": 16,
|
| 701 |
+
"data_type": "float"
|
| 702 |
+
},
|
| 703 |
+
"vision_tower.vision_model.encoder.layers.15.mlp.fc2": {
|
| 704 |
+
"bits": 16,
|
| 705 |
+
"data_type": "float"
|
| 706 |
+
},
|
| 707 |
+
"vision_tower.vision_model.encoder.layers.15.self_attn.k_proj": {
|
| 708 |
+
"bits": 16,
|
| 709 |
+
"data_type": "float"
|
| 710 |
+
},
|
| 711 |
+
"vision_tower.vision_model.encoder.layers.15.self_attn.out_proj": {
|
| 712 |
+
"bits": 16,
|
| 713 |
+
"data_type": "float"
|
| 714 |
+
},
|
| 715 |
+
"vision_tower.vision_model.encoder.layers.15.self_attn.q_proj": {
|
| 716 |
+
"bits": 16,
|
| 717 |
+
"data_type": "float"
|
| 718 |
+
},
|
| 719 |
+
"vision_tower.vision_model.encoder.layers.15.self_attn.v_proj": {
|
| 720 |
+
"bits": 16,
|
| 721 |
+
"data_type": "float"
|
| 722 |
+
},
|
| 723 |
+
"vision_tower.vision_model.encoder.layers.16.mlp.fc1": {
|
| 724 |
+
"bits": 16,
|
| 725 |
+
"data_type": "float"
|
| 726 |
+
},
|
| 727 |
+
"vision_tower.vision_model.encoder.layers.16.mlp.fc2": {
|
| 728 |
+
"bits": 16,
|
| 729 |
+
"data_type": "float"
|
| 730 |
+
},
|
| 731 |
+
"vision_tower.vision_model.encoder.layers.16.self_attn.k_proj": {
|
| 732 |
+
"bits": 16,
|
| 733 |
+
"data_type": "float"
|
| 734 |
+
},
|
| 735 |
+
"vision_tower.vision_model.encoder.layers.16.self_attn.out_proj": {
|
| 736 |
+
"bits": 16,
|
| 737 |
+
"data_type": "float"
|
| 738 |
+
},
|
| 739 |
+
"vision_tower.vision_model.encoder.layers.16.self_attn.q_proj": {
|
| 740 |
+
"bits": 16,
|
| 741 |
+
"data_type": "float"
|
| 742 |
+
},
|
| 743 |
+
"vision_tower.vision_model.encoder.layers.16.self_attn.v_proj": {
|
| 744 |
+
"bits": 16,
|
| 745 |
+
"data_type": "float"
|
| 746 |
+
},
|
| 747 |
+
"vision_tower.vision_model.encoder.layers.17.mlp.fc1": {
|
| 748 |
+
"bits": 16,
|
| 749 |
+
"data_type": "float"
|
| 750 |
+
},
|
| 751 |
+
"vision_tower.vision_model.encoder.layers.17.mlp.fc2": {
|
| 752 |
+
"bits": 16,
|
| 753 |
+
"data_type": "float"
|
| 754 |
+
},
|
| 755 |
+
"vision_tower.vision_model.encoder.layers.17.self_attn.k_proj": {
|
| 756 |
+
"bits": 16,
|
| 757 |
+
"data_type": "float"
|
| 758 |
+
},
|
| 759 |
+
"vision_tower.vision_model.encoder.layers.17.self_attn.out_proj": {
|
| 760 |
+
"bits": 16,
|
| 761 |
+
"data_type": "float"
|
| 762 |
+
},
|
| 763 |
+
"vision_tower.vision_model.encoder.layers.17.self_attn.q_proj": {
|
| 764 |
+
"bits": 16,
|
| 765 |
+
"data_type": "float"
|
| 766 |
+
},
|
| 767 |
+
"vision_tower.vision_model.encoder.layers.17.self_attn.v_proj": {
|
| 768 |
+
"bits": 16,
|
| 769 |
+
"data_type": "float"
|
| 770 |
+
},
|
| 771 |
+
"vision_tower.vision_model.encoder.layers.18.mlp.fc1": {
|
| 772 |
+
"bits": 16,
|
| 773 |
+
"data_type": "float"
|
| 774 |
+
},
|
| 775 |
+
"vision_tower.vision_model.encoder.layers.18.mlp.fc2": {
|
| 776 |
+
"bits": 16,
|
| 777 |
+
"data_type": "float"
|
| 778 |
+
},
|
| 779 |
+
"vision_tower.vision_model.encoder.layers.18.self_attn.k_proj": {
|
| 780 |
+
"bits": 16,
|
| 781 |
+
"data_type": "float"
|
| 782 |
+
},
|
| 783 |
+
"vision_tower.vision_model.encoder.layers.18.self_attn.out_proj": {
|
| 784 |
+
"bits": 16,
|
| 785 |
+
"data_type": "float"
|
| 786 |
+
},
|
| 787 |
+
"vision_tower.vision_model.encoder.layers.18.self_attn.q_proj": {
|
| 788 |
+
"bits": 16,
|
| 789 |
+
"data_type": "float"
|
| 790 |
+
},
|
| 791 |
+
"vision_tower.vision_model.encoder.layers.18.self_attn.v_proj": {
|
| 792 |
+
"bits": 16,
|
| 793 |
+
"data_type": "float"
|
| 794 |
+
},
|
| 795 |
+
"vision_tower.vision_model.encoder.layers.19.mlp.fc1": {
|
| 796 |
+
"bits": 16,
|
| 797 |
+
"data_type": "float"
|
| 798 |
+
},
|
| 799 |
+
"vision_tower.vision_model.encoder.layers.19.mlp.fc2": {
|
| 800 |
+
"bits": 16,
|
| 801 |
+
"data_type": "float"
|
| 802 |
+
},
|
| 803 |
+
"vision_tower.vision_model.encoder.layers.19.self_attn.k_proj": {
|
| 804 |
+
"bits": 16,
|
| 805 |
+
"data_type": "float"
|
| 806 |
+
},
|
| 807 |
+
"vision_tower.vision_model.encoder.layers.19.self_attn.out_proj": {
|
| 808 |
+
"bits": 16,
|
| 809 |
+
"data_type": "float"
|
| 810 |
+
},
|
| 811 |
+
"vision_tower.vision_model.encoder.layers.19.self_attn.q_proj": {
|
| 812 |
+
"bits": 16,
|
| 813 |
+
"data_type": "float"
|
| 814 |
+
},
|
| 815 |
+
"vision_tower.vision_model.encoder.layers.19.self_attn.v_proj": {
|
| 816 |
+
"bits": 16,
|
| 817 |
+
"data_type": "float"
|
| 818 |
+
},
|
| 819 |
+
"vision_tower.vision_model.encoder.layers.2.mlp.fc1": {
|
| 820 |
+
"bits": 16,
|
| 821 |
+
"data_type": "float"
|
| 822 |
+
},
|
| 823 |
+
"vision_tower.vision_model.encoder.layers.2.mlp.fc2": {
|
| 824 |
+
"bits": 16,
|
| 825 |
+
"data_type": "float"
|
| 826 |
+
},
|
| 827 |
+
"vision_tower.vision_model.encoder.layers.2.self_attn.k_proj": {
|
| 828 |
+
"bits": 16,
|
| 829 |
+
"data_type": "float"
|
| 830 |
+
},
|
| 831 |
+
"vision_tower.vision_model.encoder.layers.2.self_attn.out_proj": {
|
| 832 |
+
"bits": 16,
|
| 833 |
+
"data_type": "float"
|
| 834 |
+
},
|
| 835 |
+
"vision_tower.vision_model.encoder.layers.2.self_attn.q_proj": {
|
| 836 |
+
"bits": 16,
|
| 837 |
+
"data_type": "float"
|
| 838 |
+
},
|
| 839 |
+
"vision_tower.vision_model.encoder.layers.2.self_attn.v_proj": {
|
| 840 |
+
"bits": 16,
|
| 841 |
+
"data_type": "float"
|
| 842 |
+
},
|
| 843 |
+
"vision_tower.vision_model.encoder.layers.20.mlp.fc1": {
|
| 844 |
+
"bits": 16,
|
| 845 |
+
"data_type": "float"
|
| 846 |
+
},
|
| 847 |
+
"vision_tower.vision_model.encoder.layers.20.mlp.fc2": {
|
| 848 |
+
"bits": 16,
|
| 849 |
+
"data_type": "float"
|
| 850 |
+
},
|
| 851 |
+
"vision_tower.vision_model.encoder.layers.20.self_attn.k_proj": {
|
| 852 |
+
"bits": 16,
|
| 853 |
+
"data_type": "float"
|
| 854 |
+
},
|
| 855 |
+
"vision_tower.vision_model.encoder.layers.20.self_attn.out_proj": {
|
| 856 |
+
"bits": 16,
|
| 857 |
+
"data_type": "float"
|
| 858 |
+
},
|
| 859 |
+
"vision_tower.vision_model.encoder.layers.20.self_attn.q_proj": {
|
| 860 |
+
"bits": 16,
|
| 861 |
+
"data_type": "float"
|
| 862 |
+
},
|
| 863 |
+
"vision_tower.vision_model.encoder.layers.20.self_attn.v_proj": {
|
| 864 |
+
"bits": 16,
|
| 865 |
+
"data_type": "float"
|
| 866 |
+
},
|
| 867 |
+
"vision_tower.vision_model.encoder.layers.21.mlp.fc1": {
|
| 868 |
+
"bits": 16,
|
| 869 |
+
"data_type": "float"
|
| 870 |
+
},
|
| 871 |
+
"vision_tower.vision_model.encoder.layers.21.mlp.fc2": {
|
| 872 |
+
"bits": 16,
|
| 873 |
+
"data_type": "float"
|
| 874 |
+
},
|
| 875 |
+
"vision_tower.vision_model.encoder.layers.21.self_attn.k_proj": {
|
| 876 |
+
"bits": 16,
|
| 877 |
+
"data_type": "float"
|
| 878 |
+
},
|
| 879 |
+
"vision_tower.vision_model.encoder.layers.21.self_attn.out_proj": {
|
| 880 |
+
"bits": 16,
|
| 881 |
+
"data_type": "float"
|
| 882 |
+
},
|
| 883 |
+
"vision_tower.vision_model.encoder.layers.21.self_attn.q_proj": {
|
| 884 |
+
"bits": 16,
|
| 885 |
+
"data_type": "float"
|
| 886 |
+
},
|
| 887 |
+
"vision_tower.vision_model.encoder.layers.21.self_attn.v_proj": {
|
| 888 |
+
"bits": 16,
|
| 889 |
+
"data_type": "float"
|
| 890 |
+
},
|
| 891 |
+
"vision_tower.vision_model.encoder.layers.22.mlp.fc1": {
|
| 892 |
+
"bits": 16,
|
| 893 |
+
"data_type": "float"
|
| 894 |
+
},
|
| 895 |
+
"vision_tower.vision_model.encoder.layers.22.mlp.fc2": {
|
| 896 |
+
"bits": 16,
|
| 897 |
+
"data_type": "float"
|
| 898 |
+
},
|
| 899 |
+
"vision_tower.vision_model.encoder.layers.22.self_attn.k_proj": {
|
| 900 |
+
"bits": 16,
|
| 901 |
+
"data_type": "float"
|
| 902 |
+
},
|
| 903 |
+
"vision_tower.vision_model.encoder.layers.22.self_attn.out_proj": {
|
| 904 |
+
"bits": 16,
|
| 905 |
+
"data_type": "float"
|
| 906 |
+
},
|
| 907 |
+
"vision_tower.vision_model.encoder.layers.22.self_attn.q_proj": {
|
| 908 |
+
"bits": 16,
|
| 909 |
+
"data_type": "float"
|
| 910 |
+
},
|
| 911 |
+
"vision_tower.vision_model.encoder.layers.22.self_attn.v_proj": {
|
| 912 |
+
"bits": 16,
|
| 913 |
+
"data_type": "float"
|
| 914 |
+
},
|
| 915 |
+
"vision_tower.vision_model.encoder.layers.23.mlp.fc1": {
|
| 916 |
+
"bits": 16,
|
| 917 |
+
"data_type": "float"
|
| 918 |
+
},
|
| 919 |
+
"vision_tower.vision_model.encoder.layers.23.mlp.fc2": {
|
| 920 |
+
"bits": 16,
|
| 921 |
+
"data_type": "float"
|
| 922 |
+
},
|
| 923 |
+
"vision_tower.vision_model.encoder.layers.23.self_attn.k_proj": {
|
| 924 |
+
"bits": 16,
|
| 925 |
+
"data_type": "float"
|
| 926 |
+
},
|
| 927 |
+
"vision_tower.vision_model.encoder.layers.23.self_attn.out_proj": {
|
| 928 |
+
"bits": 16,
|
| 929 |
+
"data_type": "float"
|
| 930 |
+
},
|
| 931 |
+
"vision_tower.vision_model.encoder.layers.23.self_attn.q_proj": {
|
| 932 |
+
"bits": 16,
|
| 933 |
+
"data_type": "float"
|
| 934 |
+
},
|
| 935 |
+
"vision_tower.vision_model.encoder.layers.23.self_attn.v_proj": {
|
| 936 |
+
"bits": 16,
|
| 937 |
+
"data_type": "float"
|
| 938 |
+
},
|
| 939 |
+
"vision_tower.vision_model.encoder.layers.24.mlp.fc1": {
|
| 940 |
+
"bits": 16,
|
| 941 |
+
"data_type": "float"
|
| 942 |
+
},
|
| 943 |
+
"vision_tower.vision_model.encoder.layers.24.mlp.fc2": {
|
| 944 |
+
"bits": 16,
|
| 945 |
+
"data_type": "float"
|
| 946 |
+
},
|
| 947 |
+
"vision_tower.vision_model.encoder.layers.24.self_attn.k_proj": {
|
| 948 |
+
"bits": 16,
|
| 949 |
+
"data_type": "float"
|
| 950 |
+
},
|
| 951 |
+
"vision_tower.vision_model.encoder.layers.24.self_attn.out_proj": {
|
| 952 |
+
"bits": 16,
|
| 953 |
+
"data_type": "float"
|
| 954 |
+
},
|
| 955 |
+
"vision_tower.vision_model.encoder.layers.24.self_attn.q_proj": {
|
| 956 |
+
"bits": 16,
|
| 957 |
+
"data_type": "float"
|
| 958 |
+
},
|
| 959 |
+
"vision_tower.vision_model.encoder.layers.24.self_attn.v_proj": {
|
| 960 |
+
"bits": 16,
|
| 961 |
+
"data_type": "float"
|
| 962 |
+
},
|
| 963 |
+
"vision_tower.vision_model.encoder.layers.25.mlp.fc1": {
|
| 964 |
+
"bits": 16,
|
| 965 |
+
"data_type": "float"
|
| 966 |
+
},
|
| 967 |
+
"vision_tower.vision_model.encoder.layers.25.mlp.fc2": {
|
| 968 |
+
"bits": 16,
|
| 969 |
+
"data_type": "float"
|
| 970 |
+
},
|
| 971 |
+
"vision_tower.vision_model.encoder.layers.25.self_attn.k_proj": {
|
| 972 |
+
"bits": 16,
|
| 973 |
+
"data_type": "float"
|
| 974 |
+
},
|
| 975 |
+
"vision_tower.vision_model.encoder.layers.25.self_attn.out_proj": {
|
| 976 |
+
"bits": 16,
|
| 977 |
+
"data_type": "float"
|
| 978 |
+
},
|
| 979 |
+
"vision_tower.vision_model.encoder.layers.25.self_attn.q_proj": {
|
| 980 |
+
"bits": 16,
|
| 981 |
+
"data_type": "float"
|
| 982 |
+
},
|
| 983 |
+
"vision_tower.vision_model.encoder.layers.25.self_attn.v_proj": {
|
| 984 |
+
"bits": 16,
|
| 985 |
+
"data_type": "float"
|
| 986 |
+
},
|
| 987 |
+
"vision_tower.vision_model.encoder.layers.26.mlp.fc1": {
|
| 988 |
+
"bits": 16,
|
| 989 |
+
"data_type": "float"
|
| 990 |
+
},
|
| 991 |
+
"vision_tower.vision_model.encoder.layers.26.mlp.fc2": {
|
| 992 |
+
"bits": 16,
|
| 993 |
+
"data_type": "float"
|
| 994 |
+
},
|
| 995 |
+
"vision_tower.vision_model.encoder.layers.26.self_attn.k_proj": {
|
| 996 |
+
"bits": 16,
|
| 997 |
+
"data_type": "float"
|
| 998 |
+
},
|
| 999 |
+
"vision_tower.vision_model.encoder.layers.26.self_attn.out_proj": {
|
| 1000 |
+
"bits": 16,
|
| 1001 |
+
"data_type": "float"
|
| 1002 |
+
},
|
| 1003 |
+
"vision_tower.vision_model.encoder.layers.26.self_attn.q_proj": {
|
| 1004 |
+
"bits": 16,
|
| 1005 |
+
"data_type": "float"
|
| 1006 |
+
},
|
| 1007 |
+
"vision_tower.vision_model.encoder.layers.26.self_attn.v_proj": {
|
| 1008 |
+
"bits": 16,
|
| 1009 |
+
"data_type": "float"
|
| 1010 |
+
},
|
| 1011 |
+
"vision_tower.vision_model.encoder.layers.27.mlp.fc1": {
|
| 1012 |
+
"bits": 16,
|
| 1013 |
+
"data_type": "float"
|
| 1014 |
+
},
|
| 1015 |
+
"vision_tower.vision_model.encoder.layers.27.mlp.fc2": {
|
| 1016 |
+
"bits": 16,
|
| 1017 |
+
"data_type": "float"
|
| 1018 |
+
},
|
| 1019 |
+
"vision_tower.vision_model.encoder.layers.27.self_attn.k_proj": {
|
| 1020 |
+
"bits": 16,
|
| 1021 |
+
"data_type": "float"
|
| 1022 |
+
},
|
| 1023 |
+
"vision_tower.vision_model.encoder.layers.27.self_attn.out_proj": {
|
| 1024 |
+
"bits": 16,
|
| 1025 |
+
"data_type": "float"
|
| 1026 |
+
},
|
| 1027 |
+
"vision_tower.vision_model.encoder.layers.27.self_attn.q_proj": {
|
| 1028 |
+
"bits": 16,
|
| 1029 |
+
"data_type": "float"
|
| 1030 |
+
},
|
| 1031 |
+
"vision_tower.vision_model.encoder.layers.27.self_attn.v_proj": {
|
| 1032 |
+
"bits": 16,
|
| 1033 |
+
"data_type": "float"
|
| 1034 |
+
},
|
| 1035 |
+
"vision_tower.vision_model.encoder.layers.28.mlp.fc1": {
|
| 1036 |
+
"bits": 16,
|
| 1037 |
+
"data_type": "float"
|
| 1038 |
+
},
|
| 1039 |
+
"vision_tower.vision_model.encoder.layers.28.mlp.fc2": {
|
| 1040 |
+
"bits": 16,
|
| 1041 |
+
"data_type": "float"
|
| 1042 |
+
},
|
| 1043 |
+
"vision_tower.vision_model.encoder.layers.28.self_attn.k_proj": {
|
| 1044 |
+
"bits": 16,
|
| 1045 |
+
"data_type": "float"
|
| 1046 |
+
},
|
| 1047 |
+
"vision_tower.vision_model.encoder.layers.28.self_attn.out_proj": {
|
| 1048 |
+
"bits": 16,
|
| 1049 |
+
"data_type": "float"
|
| 1050 |
+
},
|
| 1051 |
+
"vision_tower.vision_model.encoder.layers.28.self_attn.q_proj": {
|
| 1052 |
+
"bits": 16,
|
| 1053 |
+
"data_type": "float"
|
| 1054 |
+
},
|
| 1055 |
+
"vision_tower.vision_model.encoder.layers.28.self_attn.v_proj": {
|
| 1056 |
+
"bits": 16,
|
| 1057 |
+
"data_type": "float"
|
| 1058 |
+
},
|
| 1059 |
+
"vision_tower.vision_model.encoder.layers.29.mlp.fc1": {
|
| 1060 |
+
"bits": 16,
|
| 1061 |
+
"data_type": "float"
|
| 1062 |
+
},
|
| 1063 |
+
"vision_tower.vision_model.encoder.layers.29.mlp.fc2": {
|
| 1064 |
+
"bits": 16,
|
| 1065 |
+
"data_type": "float"
|
| 1066 |
+
},
|
| 1067 |
+
"vision_tower.vision_model.encoder.layers.29.self_attn.k_proj": {
|
| 1068 |
+
"bits": 16,
|
| 1069 |
+
"data_type": "float"
|
| 1070 |
+
},
|
| 1071 |
+
"vision_tower.vision_model.encoder.layers.29.self_attn.out_proj": {
|
| 1072 |
+
"bits": 16,
|
| 1073 |
+
"data_type": "float"
|
| 1074 |
+
},
|
| 1075 |
+
"vision_tower.vision_model.encoder.layers.29.self_attn.q_proj": {
|
| 1076 |
+
"bits": 16,
|
| 1077 |
+
"data_type": "float"
|
| 1078 |
+
},
|
| 1079 |
+
"vision_tower.vision_model.encoder.layers.29.self_attn.v_proj": {
|
| 1080 |
+
"bits": 16,
|
| 1081 |
+
"data_type": "float"
|
| 1082 |
+
},
|
| 1083 |
+
"vision_tower.vision_model.encoder.layers.3.mlp.fc1": {
|
| 1084 |
+
"bits": 16,
|
| 1085 |
+
"data_type": "float"
|
| 1086 |
+
},
|
| 1087 |
+
"vision_tower.vision_model.encoder.layers.3.mlp.fc2": {
|
| 1088 |
+
"bits": 16,
|
| 1089 |
+
"data_type": "float"
|
| 1090 |
+
},
|
| 1091 |
+
"vision_tower.vision_model.encoder.layers.3.self_attn.k_proj": {
|
| 1092 |
+
"bits": 16,
|
| 1093 |
+
"data_type": "float"
|
| 1094 |
+
},
|
| 1095 |
+
"vision_tower.vision_model.encoder.layers.3.self_attn.out_proj": {
|
| 1096 |
+
"bits": 16,
|
| 1097 |
+
"data_type": "float"
|
| 1098 |
+
},
|
| 1099 |
+
"vision_tower.vision_model.encoder.layers.3.self_attn.q_proj": {
|
| 1100 |
+
"bits": 16,
|
| 1101 |
+
"data_type": "float"
|
| 1102 |
+
},
|
| 1103 |
+
"vision_tower.vision_model.encoder.layers.3.self_attn.v_proj": {
|
| 1104 |
+
"bits": 16,
|
| 1105 |
+
"data_type": "float"
|
| 1106 |
+
},
|
| 1107 |
+
"vision_tower.vision_model.encoder.layers.30.mlp.fc1": {
|
| 1108 |
+
"bits": 16,
|
| 1109 |
+
"data_type": "float"
|
| 1110 |
+
},
|
| 1111 |
+
"vision_tower.vision_model.encoder.layers.30.mlp.fc2": {
|
| 1112 |
+
"bits": 16,
|
| 1113 |
+
"data_type": "float"
|
| 1114 |
+
},
|
| 1115 |
+
"vision_tower.vision_model.encoder.layers.30.self_attn.k_proj": {
|
| 1116 |
+
"bits": 16,
|
| 1117 |
+
"data_type": "float"
|
| 1118 |
+
},
|
| 1119 |
+
"vision_tower.vision_model.encoder.layers.30.self_attn.out_proj": {
|
| 1120 |
+
"bits": 16,
|
| 1121 |
+
"data_type": "float"
|
| 1122 |
+
},
|
| 1123 |
+
"vision_tower.vision_model.encoder.layers.30.self_attn.q_proj": {
|
| 1124 |
+
"bits": 16,
|
| 1125 |
+
"data_type": "float"
|
| 1126 |
+
},
|
| 1127 |
+
"vision_tower.vision_model.encoder.layers.30.self_attn.v_proj": {
|
| 1128 |
+
"bits": 16,
|
| 1129 |
+
"data_type": "float"
|
| 1130 |
+
},
|
| 1131 |
+
"vision_tower.vision_model.encoder.layers.31.mlp.fc1": {
|
| 1132 |
+
"bits": 16,
|
| 1133 |
+
"data_type": "float"
|
| 1134 |
+
},
|
| 1135 |
+
"vision_tower.vision_model.encoder.layers.31.mlp.fc2": {
|
| 1136 |
+
"bits": 16,
|
| 1137 |
+
"data_type": "float"
|
| 1138 |
+
},
|
| 1139 |
+
"vision_tower.vision_model.encoder.layers.31.self_attn.k_proj": {
|
| 1140 |
+
"bits": 16,
|
| 1141 |
+
"data_type": "float"
|
| 1142 |
+
},
|
| 1143 |
+
"vision_tower.vision_model.encoder.layers.31.self_attn.out_proj": {
|
| 1144 |
+
"bits": 16,
|
| 1145 |
+
"data_type": "float"
|
| 1146 |
+
},
|
| 1147 |
+
"vision_tower.vision_model.encoder.layers.31.self_attn.q_proj": {
|
| 1148 |
+
"bits": 16,
|
| 1149 |
+
"data_type": "float"
|
| 1150 |
+
},
|
| 1151 |
+
"vision_tower.vision_model.encoder.layers.31.self_attn.v_proj": {
|
| 1152 |
+
"bits": 16,
|
| 1153 |
+
"data_type": "float"
|
| 1154 |
+
},
|
| 1155 |
+
"vision_tower.vision_model.encoder.layers.4.mlp.fc1": {
|
| 1156 |
+
"bits": 16,
|
| 1157 |
+
"data_type": "float"
|
| 1158 |
+
},
|
| 1159 |
+
"vision_tower.vision_model.encoder.layers.4.mlp.fc2": {
|
| 1160 |
+
"bits": 16,
|
| 1161 |
+
"data_type": "float"
|
| 1162 |
+
},
|
| 1163 |
+
"vision_tower.vision_model.encoder.layers.4.self_attn.k_proj": {
|
| 1164 |
+
"bits": 16,
|
| 1165 |
+
"data_type": "float"
|
| 1166 |
+
},
|
| 1167 |
+
"vision_tower.vision_model.encoder.layers.4.self_attn.out_proj": {
|
| 1168 |
+
"bits": 16,
|
| 1169 |
+
"data_type": "float"
|
| 1170 |
+
},
|
| 1171 |
+
"vision_tower.vision_model.encoder.layers.4.self_attn.q_proj": {
|
| 1172 |
+
"bits": 16,
|
| 1173 |
+
"data_type": "float"
|
| 1174 |
+
},
|
| 1175 |
+
"vision_tower.vision_model.encoder.layers.4.self_attn.v_proj": {
|
| 1176 |
+
"bits": 16,
|
| 1177 |
+
"data_type": "float"
|
| 1178 |
+
},
|
| 1179 |
+
"vision_tower.vision_model.encoder.layers.5.mlp.fc1": {
|
| 1180 |
+
"bits": 16,
|
| 1181 |
+
"data_type": "float"
|
| 1182 |
+
},
|
| 1183 |
+
"vision_tower.vision_model.encoder.layers.5.mlp.fc2": {
|
| 1184 |
+
"bits": 16,
|
| 1185 |
+
"data_type": "float"
|
| 1186 |
+
},
|
| 1187 |
+
"vision_tower.vision_model.encoder.layers.5.self_attn.k_proj": {
|
| 1188 |
+
"bits": 16,
|
| 1189 |
+
"data_type": "float"
|
| 1190 |
+
},
|
| 1191 |
+
"vision_tower.vision_model.encoder.layers.5.self_attn.out_proj": {
|
| 1192 |
+
"bits": 16,
|
| 1193 |
+
"data_type": "float"
|
| 1194 |
+
},
|
| 1195 |
+
"vision_tower.vision_model.encoder.layers.5.self_attn.q_proj": {
|
| 1196 |
+
"bits": 16,
|
| 1197 |
+
"data_type": "float"
|
| 1198 |
+
},
|
| 1199 |
+
"vision_tower.vision_model.encoder.layers.5.self_attn.v_proj": {
|
| 1200 |
+
"bits": 16,
|
| 1201 |
+
"data_type": "float"
|
| 1202 |
+
},
|
| 1203 |
+
"vision_tower.vision_model.encoder.layers.6.mlp.fc1": {
|
| 1204 |
+
"bits": 16,
|
| 1205 |
+
"data_type": "float"
|
| 1206 |
+
},
|
| 1207 |
+
"vision_tower.vision_model.encoder.layers.6.mlp.fc2": {
|
| 1208 |
+
"bits": 16,
|
| 1209 |
+
"data_type": "float"
|
| 1210 |
+
},
|
| 1211 |
+
"vision_tower.vision_model.encoder.layers.6.self_attn.k_proj": {
|
| 1212 |
+
"bits": 16,
|
| 1213 |
+
"data_type": "float"
|
| 1214 |
+
},
|
| 1215 |
+
"vision_tower.vision_model.encoder.layers.6.self_attn.out_proj": {
|
| 1216 |
+
"bits": 16,
|
| 1217 |
+
"data_type": "float"
|
| 1218 |
+
},
|
| 1219 |
+
"vision_tower.vision_model.encoder.layers.6.self_attn.q_proj": {
|
| 1220 |
+
"bits": 16,
|
| 1221 |
+
"data_type": "float"
|
| 1222 |
+
},
|
| 1223 |
+
"vision_tower.vision_model.encoder.layers.6.self_attn.v_proj": {
|
| 1224 |
+
"bits": 16,
|
| 1225 |
+
"data_type": "float"
|
| 1226 |
+
},
|
| 1227 |
+
"vision_tower.vision_model.encoder.layers.7.mlp.fc1": {
|
| 1228 |
+
"bits": 16,
|
| 1229 |
+
"data_type": "float"
|
| 1230 |
+
},
|
| 1231 |
+
"vision_tower.vision_model.encoder.layers.7.mlp.fc2": {
|
| 1232 |
+
"bits": 16,
|
| 1233 |
+
"data_type": "float"
|
| 1234 |
+
},
|
| 1235 |
+
"vision_tower.vision_model.encoder.layers.7.self_attn.k_proj": {
|
| 1236 |
+
"bits": 16,
|
| 1237 |
+
"data_type": "float"
|
| 1238 |
+
},
|
| 1239 |
+
"vision_tower.vision_model.encoder.layers.7.self_attn.out_proj": {
|
| 1240 |
+
"bits": 16,
|
| 1241 |
+
"data_type": "float"
|
| 1242 |
+
},
|
| 1243 |
+
"vision_tower.vision_model.encoder.layers.7.self_attn.q_proj": {
|
| 1244 |
+
"bits": 16,
|
| 1245 |
+
"data_type": "float"
|
| 1246 |
+
},
|
| 1247 |
+
"vision_tower.vision_model.encoder.layers.7.self_attn.v_proj": {
|
| 1248 |
+
"bits": 16,
|
| 1249 |
+
"data_type": "float"
|
| 1250 |
+
},
|
| 1251 |
+
"vision_tower.vision_model.encoder.layers.8.mlp.fc1": {
|
| 1252 |
+
"bits": 16,
|
| 1253 |
+
"data_type": "float"
|
| 1254 |
+
},
|
| 1255 |
+
"vision_tower.vision_model.encoder.layers.8.mlp.fc2": {
|
| 1256 |
+
"bits": 16,
|
| 1257 |
+
"data_type": "float"
|
| 1258 |
+
},
|
| 1259 |
+
"vision_tower.vision_model.encoder.layers.8.self_attn.k_proj": {
|
| 1260 |
+
"bits": 16,
|
| 1261 |
+
"data_type": "float"
|
| 1262 |
+
},
|
| 1263 |
+
"vision_tower.vision_model.encoder.layers.8.self_attn.out_proj": {
|
| 1264 |
+
"bits": 16,
|
| 1265 |
+
"data_type": "float"
|
| 1266 |
+
},
|
| 1267 |
+
"vision_tower.vision_model.encoder.layers.8.self_attn.q_proj": {
|
| 1268 |
+
"bits": 16,
|
| 1269 |
+
"data_type": "float"
|
| 1270 |
+
},
|
| 1271 |
+
"vision_tower.vision_model.encoder.layers.8.self_attn.v_proj": {
|
| 1272 |
+
"bits": 16,
|
| 1273 |
+
"data_type": "float"
|
| 1274 |
+
},
|
| 1275 |
+
"vision_tower.vision_model.encoder.layers.9.mlp.fc1": {
|
| 1276 |
+
"bits": 16,
|
| 1277 |
+
"data_type": "float"
|
| 1278 |
+
},
|
| 1279 |
+
"vision_tower.vision_model.encoder.layers.9.mlp.fc2": {
|
| 1280 |
+
"bits": 16,
|
| 1281 |
+
"data_type": "float"
|
| 1282 |
+
},
|
| 1283 |
+
"vision_tower.vision_model.encoder.layers.9.self_attn.k_proj": {
|
| 1284 |
+
"bits": 16,
|
| 1285 |
+
"data_type": "float"
|
| 1286 |
+
},
|
| 1287 |
+
"vision_tower.vision_model.encoder.layers.9.self_attn.out_proj": {
|
| 1288 |
+
"bits": 16,
|
| 1289 |
+
"data_type": "float"
|
| 1290 |
+
},
|
| 1291 |
+
"vision_tower.vision_model.encoder.layers.9.self_attn.q_proj": {
|
| 1292 |
+
"bits": 16,
|
| 1293 |
+
"data_type": "float"
|
| 1294 |
+
},
|
| 1295 |
+
"vision_tower.vision_model.encoder.layers.9.self_attn.v_proj": {
|
| 1296 |
+
"bits": 16,
|
| 1297 |
+
"data_type": "float"
|
| 1298 |
+
},
|
| 1299 |
+
"multi_modal_projector.linear_1": {
|
| 1300 |
+
"bits": 16,
|
| 1301 |
+
"data_type": "float"
|
| 1302 |
+
},
|
| 1303 |
+
"multi_modal_projector.linear_2": {
|
| 1304 |
+
"bits": 16,
|
| 1305 |
+
"data_type": "float"
|
| 1306 |
+
},
|
| 1307 |
+
"patch_merge_mlp.linear_1": {
|
| 1308 |
+
"bits": 16,
|
| 1309 |
+
"data_type": "float"
|
| 1310 |
+
},
|
| 1311 |
+
"patch_merge_mlp.linear_2": {
|
| 1312 |
+
"bits": 16,
|
| 1313 |
+
"data_type": "float"
|
| 1314 |
+
}
|
| 1315 |
+
}
|
| 1316 |
+
}
|
| 1317 |
+
}
|
configuration_minimax_m3_vl.py
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""HuggingFace configs for the MiniMax VL family (M2 VL / M3 VL).
|
| 2 |
+
|
| 3 |
+
This file is bundled into every converted HF checkpoint so that loading via
|
| 4 |
+
``AutoConfig.from_pretrained(..., trust_remote_code=True)`` works without any
|
| 5 |
+
runtime dependency on sglang or other internal packages — only stock
|
| 6 |
+
``transformers`` is required.
|
| 7 |
+
|
| 8 |
+
The class definitions intentionally mirror
|
| 9 |
+
``sglang.srt.configs.minimax_vl``; if either side changes, keep them in sync.
|
| 10 |
+
|
| 11 |
+
The file is named ``configuration_minimax_m3_vl.py`` (matching the legacy
|
| 12 |
+
``model_type="minimax_m3_vl"`` and the converter's ``auto_map`` entry) so
|
| 13 |
+
that ckpts produced by this converter remain loadable by older sglang versions
|
| 14 |
+
that only know the ``MiniMaxM3VL*`` names. The canonical class is
|
| 15 |
+
``MiniMaxM3VLConfig``; ``MiniMaxM3VLConfig`` is a thin BC alias whose only
|
| 16 |
+
purpose is to be referenced from ``auto_map``.
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
from typing import Optional
|
| 20 |
+
|
| 21 |
+
from transformers.configuration_utils import PretrainedConfig
|
| 22 |
+
from transformers.models.auto import CONFIG_MAPPING
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
def _coerce_sub_config(
|
| 26 |
+
sub_config: Optional[dict], default_model_type: str
|
| 27 |
+
) -> Optional[PretrainedConfig]:
|
| 28 |
+
"""Convert a config dict to a ``PretrainedConfig`` instance.
|
| 29 |
+
|
| 30 |
+
If ``model_type`` is registered in HF ``CONFIG_MAPPING`` the corresponding
|
| 31 |
+
config class is used; otherwise we fall back to a generic
|
| 32 |
+
``PretrainedConfig`` so all dict keys still become real attributes (M3's
|
| 33 |
+
text backbone uses ``model_type="minimax_m2"`` which is not in
|
| 34 |
+
``CONFIG_MAPPING``).
|
| 35 |
+
"""
|
| 36 |
+
if not isinstance(sub_config, dict):
|
| 37 |
+
return sub_config
|
| 38 |
+
model_type = sub_config.get("model_type", default_model_type)
|
| 39 |
+
cls = CONFIG_MAPPING.get(model_type, PretrainedConfig)
|
| 40 |
+
return cls(**sub_config)
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
class MiniMaxVLBaseConfig(PretrainedConfig):
|
| 44 |
+
"""Base config shared by every MiniMax VL variant.
|
| 45 |
+
|
| 46 |
+
Handles vision/text sub-config coercion. Concrete subclasses only need to
|
| 47 |
+
declare a unique ``model_type`` string.
|
| 48 |
+
"""
|
| 49 |
+
|
| 50 |
+
def __init__(
|
| 51 |
+
self,
|
| 52 |
+
vision_config: Optional[dict] = None,
|
| 53 |
+
text_config: Optional[dict] = None,
|
| 54 |
+
image_token_index: int = 200025,
|
| 55 |
+
video_token_index: int = 200026,
|
| 56 |
+
image_seq_length: int = 576,
|
| 57 |
+
process_image_mode: str = "dynamic_res",
|
| 58 |
+
projector_hidden_act: str = "gelu",
|
| 59 |
+
multimodal_projector_bias: bool = True,
|
| 60 |
+
vision_feature_layer: int = -1,
|
| 61 |
+
vision_feature_select_strategy: str = "full",
|
| 62 |
+
img_token_compression_config: Optional[dict] = None,
|
| 63 |
+
image_grid_pinpoints: Optional[str] = None,
|
| 64 |
+
**kwargs,
|
| 65 |
+
):
|
| 66 |
+
self.vision_config = _coerce_sub_config(vision_config, "clip_vision_model")
|
| 67 |
+
self.text_config = _coerce_sub_config(text_config, "mixtral")
|
| 68 |
+
|
| 69 |
+
self.image_token_index = image_token_index
|
| 70 |
+
self.video_token_index = video_token_index
|
| 71 |
+
self.image_seq_length = image_seq_length
|
| 72 |
+
self.process_image_mode = process_image_mode
|
| 73 |
+
self.projector_hidden_act = projector_hidden_act
|
| 74 |
+
self.multimodal_projector_bias = multimodal_projector_bias
|
| 75 |
+
self.vision_feature_layer = vision_feature_layer
|
| 76 |
+
self.vision_feature_select_strategy = vision_feature_select_strategy
|
| 77 |
+
self.img_token_compression_config = img_token_compression_config or {}
|
| 78 |
+
self.image_grid_pinpoints = image_grid_pinpoints
|
| 79 |
+
|
| 80 |
+
super().__init__(**kwargs)
|
| 81 |
+
|
| 82 |
+
def __post_init__(self, **kwargs):
|
| 83 |
+
super().__post_init__(**kwargs)
|
| 84 |
+
if hasattr(self, "vision_config"):
|
| 85 |
+
self.vision_config = _coerce_sub_config(self.vision_config, "clip_vision_model")
|
| 86 |
+
if hasattr(self, "text_config"):
|
| 87 |
+
self.text_config = _coerce_sub_config(self.text_config, "mixtral")
|
| 88 |
+
|
| 89 |
+
|
| 90 |
+
class MiniMaxM2VLConfig(MiniMaxVLBaseConfig):
|
| 91 |
+
"""MiniMax M2 VL: vision tower + M2 (Mixtral-style MoE) text backbone."""
|
| 92 |
+
|
| 93 |
+
model_type = "minimax_m2_vl"
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
class MiniMaxM3VLConfig(MiniMaxVLBaseConfig):
|
| 97 |
+
"""MiniMax M3 VL: vision tower + M3 (mixed sparse/dense MoE) text backbone."""
|
| 98 |
+
|
| 99 |
+
model_type = "minimax_m3_vl"
|
| 100 |
+
|
| 101 |
+
|
| 102 |
+
class MiniMaxM2MiniVLConfig(MiniMaxM2VLConfig):
|
| 103 |
+
"""Legacy alias kept so old ``model_type="minimax_m2_mini_vl"`` ckpts load."""
|
| 104 |
+
|
| 105 |
+
model_type = "minimax_m2_mini_vl"
|
| 106 |
+
|
| 107 |
+
|
| 108 |
+
class MiniMaxM3VLConfig(MiniMaxM3VLConfig):
|
| 109 |
+
"""Legacy alias kept so old ``model_type="minimax_m3_vl"`` ckpts load."""
|
| 110 |
+
|
| 111 |
+
model_type = "minimax_m3_vl"
|
figures/efficiency_gqa_vs_msa.png
ADDED
|
figures/logo.svg
ADDED
|
|
generation_config.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 200019,
|
| 3 |
+
"do_sample": true,
|
| 4 |
+
"eos_token_id": 200020,
|
| 5 |
+
"temperature": 1.0,
|
| 6 |
+
"top_p": 0.95,
|
| 7 |
+
"transformers_version": "4.46.1"
|
| 8 |
+
}
|
image_processor.py
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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version 2.0 (the "License");
|
| 3 |
+
"""
|
| 4 |
+
MiniMax VL family HuggingFace-compatible Processor, ImageProcessor, VideoProcessor.
|
| 5 |
+
"""
|
| 6 |
+
import math
|
| 7 |
+
from typing import List, Tuple
|
| 8 |
+
|
| 9 |
+
import torch
|
| 10 |
+
from torchvision.transforms import InterpolationMode
|
| 11 |
+
from transformers import BatchFeature
|
| 12 |
+
from transformers.image_processing_utils_fast import (
|
| 13 |
+
BaseImageProcessorFast,
|
| 14 |
+
group_images_by_shape,
|
| 15 |
+
reorder_images,
|
| 16 |
+
)
|
| 17 |
+
from transformers.image_utils import PILImageResampling, SizeDict
|
| 18 |
+
from transformers.processing_utils import (
|
| 19 |
+
ImagesKwargs,
|
| 20 |
+
Unpack,
|
| 21 |
+
)
|
| 22 |
+
from transformers.utils import TensorType
|
| 23 |
+
|
| 24 |
+
MAX_RATIO = 200
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
def round_by_factor(number: int, factor: int) -> int:
|
| 28 |
+
return round(number / factor) * factor
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
def ceil_by_factor(number: int, factor: int) -> int:
|
| 32 |
+
return math.ceil(number / factor) * factor
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def floor_by_factor(number: int, factor: int) -> int:
|
| 36 |
+
return math.floor(number / factor) * factor
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
def smart_resize(
|
| 40 |
+
height: int,
|
| 41 |
+
width: int,
|
| 42 |
+
factor: int = 28,
|
| 43 |
+
min_pixels: int = 4 * 28 * 28,
|
| 44 |
+
max_pixels: int = 451584,
|
| 45 |
+
) -> tuple[int, int]:
|
| 46 |
+
if max(height, width) / min(height, width) > MAX_RATIO:
|
| 47 |
+
raise ValueError(
|
| 48 |
+
f"absolute aspect ratio must be smaller than {MAX_RATIO}, "
|
| 49 |
+
f"got {max(height, width) / min(height, width)}"
|
| 50 |
+
)
|
| 51 |
+
h_bar = max(factor, round_by_factor(height, factor))
|
| 52 |
+
w_bar = max(factor, round_by_factor(width, factor))
|
| 53 |
+
if h_bar * w_bar > max_pixels:
|
| 54 |
+
beta = math.sqrt((height * width) / max_pixels)
|
| 55 |
+
h_bar = floor_by_factor(height / beta, factor)
|
| 56 |
+
w_bar = floor_by_factor(width / beta, factor)
|
| 57 |
+
elif h_bar * w_bar < min_pixels:
|
| 58 |
+
beta = math.sqrt(min_pixels / (height * width))
|
| 59 |
+
h_bar = ceil_by_factor(height * beta, factor)
|
| 60 |
+
w_bar = ceil_by_factor(width * beta, factor)
|
| 61 |
+
return h_bar, w_bar
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
# ==============================================================================
|
| 65 |
+
# MiniMax M3 VL Image Processor Fast (Fast Mode - Torch based)
|
| 66 |
+
# ==============================================================================
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
class MiniMaxM3VLImageProcessorKwargs(ImagesKwargs, total=False):
|
| 70 |
+
patch_size: int
|
| 71 |
+
temporal_patch_size: int
|
| 72 |
+
merge_size: int
|
| 73 |
+
max_pixels: int
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
class MiniMaxM3VLImageProcessor(BaseImageProcessorFast):
|
| 77 |
+
do_resize = True
|
| 78 |
+
resample = PILImageResampling.BICUBIC
|
| 79 |
+
size = {"height": 672, "width": 672} # required by base class validation, not used as resize bound
|
| 80 |
+
default_to_square = False
|
| 81 |
+
do_rescale = True
|
| 82 |
+
rescale_factor = 1 / 255
|
| 83 |
+
do_normalize = True
|
| 84 |
+
image_mean = [0.48145466, 0.4578275, 0.40821073]
|
| 85 |
+
image_std = [0.26862954, 0.26130258, 0.27577711]
|
| 86 |
+
do_convert_rgb = True
|
| 87 |
+
patch_size = 14
|
| 88 |
+
temporal_patch_size = 2
|
| 89 |
+
merge_size = 2
|
| 90 |
+
max_pixels = 451584 # 672*672
|
| 91 |
+
valid_kwargs = MiniMaxM3VLImageProcessorKwargs
|
| 92 |
+
model_input_names = ["pixel_values", "image_grid_thw"]
|
| 93 |
+
|
| 94 |
+
def __init__(self, **kwargs: Unpack[MiniMaxM3VLImageProcessorKwargs]):
|
| 95 |
+
super().__init__(**kwargs)
|
| 96 |
+
|
| 97 |
+
def preprocess(
|
| 98 |
+
self, images, **kwargs: Unpack[MiniMaxM3VLImageProcessorKwargs]
|
| 99 |
+
) -> BatchFeature:
|
| 100 |
+
return super().preprocess(images, **kwargs)
|
| 101 |
+
|
| 102 |
+
def _preprocess(
|
| 103 |
+
self,
|
| 104 |
+
images: List[torch.Tensor],
|
| 105 |
+
do_resize: bool,
|
| 106 |
+
size: SizeDict,
|
| 107 |
+
resample: PILImageResampling | InterpolationMode | int | None,
|
| 108 |
+
do_rescale: bool,
|
| 109 |
+
rescale_factor: float,
|
| 110 |
+
do_normalize: bool,
|
| 111 |
+
image_mean: float | List[float] | None,
|
| 112 |
+
image_std: float | List[float] | None,
|
| 113 |
+
patch_size: int,
|
| 114 |
+
temporal_patch_size: int,
|
| 115 |
+
merge_size: int,
|
| 116 |
+
max_pixels: int,
|
| 117 |
+
disable_grouping: bool | None,
|
| 118 |
+
return_tensors: str | TensorType | None,
|
| 119 |
+
**kwargs,
|
| 120 |
+
) -> BatchFeature:
|
| 121 |
+
grouped_images, grouped_images_index = group_images_by_shape(
|
| 122 |
+
images, disable_grouping=disable_grouping
|
| 123 |
+
)
|
| 124 |
+
resized_images_grouped = {}
|
| 125 |
+
factor = patch_size * merge_size
|
| 126 |
+
for shape, stacked_images in grouped_images.items():
|
| 127 |
+
height, width = stacked_images.shape[-2:]
|
| 128 |
+
if do_resize:
|
| 129 |
+
resized_height, resized_width = smart_resize(
|
| 130 |
+
height, width, factor=factor,
|
| 131 |
+
max_pixels=max_pixels,
|
| 132 |
+
)
|
| 133 |
+
stacked_images = self.resize(
|
| 134 |
+
stacked_images,
|
| 135 |
+
size=SizeDict(height=resized_height, width=resized_width),
|
| 136 |
+
resample=resample,
|
| 137 |
+
)
|
| 138 |
+
resized_images_grouped[shape] = stacked_images
|
| 139 |
+
|
| 140 |
+
resized_images = reorder_images(resized_images_grouped, grouped_images_index)
|
| 141 |
+
|
| 142 |
+
grouped_images, grouped_images_index = group_images_by_shape(
|
| 143 |
+
resized_images, disable_grouping=disable_grouping
|
| 144 |
+
)
|
| 145 |
+
processed_images_grouped = {}
|
| 146 |
+
processed_grids = {}
|
| 147 |
+
|
| 148 |
+
for shape, stacked_images in grouped_images.items():
|
| 149 |
+
resized_height, resized_width = stacked_images.shape[-2:]
|
| 150 |
+
|
| 151 |
+
patches = self.rescale_and_normalize(
|
| 152 |
+
stacked_images,
|
| 153 |
+
do_rescale,
|
| 154 |
+
rescale_factor,
|
| 155 |
+
do_normalize,
|
| 156 |
+
image_mean,
|
| 157 |
+
image_std,
|
| 158 |
+
)
|
| 159 |
+
if patches.ndim == 4:
|
| 160 |
+
patches = patches.unsqueeze(1)
|
| 161 |
+
|
| 162 |
+
if patches.shape[1] % temporal_patch_size != 0:
|
| 163 |
+
repeats = patches[:, -1:].repeat(
|
| 164 |
+
1,
|
| 165 |
+
temporal_patch_size - (patches.shape[1] % temporal_patch_size),
|
| 166 |
+
1,
|
| 167 |
+
1,
|
| 168 |
+
1,
|
| 169 |
+
)
|
| 170 |
+
patches = torch.cat([patches, repeats], dim=1)
|
| 171 |
+
|
| 172 |
+
batch_size, grid_t, channel = patches.shape[:3]
|
| 173 |
+
grid_t = grid_t // temporal_patch_size
|
| 174 |
+
grid_h, grid_w = resized_height // patch_size, resized_width // patch_size
|
| 175 |
+
|
| 176 |
+
patches = patches.view(
|
| 177 |
+
batch_size,
|
| 178 |
+
grid_t,
|
| 179 |
+
temporal_patch_size,
|
| 180 |
+
channel,
|
| 181 |
+
grid_h // merge_size,
|
| 182 |
+
merge_size,
|
| 183 |
+
patch_size,
|
| 184 |
+
grid_w // merge_size,
|
| 185 |
+
merge_size,
|
| 186 |
+
patch_size,
|
| 187 |
+
)
|
| 188 |
+
patches = patches.permute(0, 1, 4, 7, 5, 8, 3, 2, 6, 9)
|
| 189 |
+
|
| 190 |
+
flatten_patches = patches.reshape(
|
| 191 |
+
batch_size,
|
| 192 |
+
grid_t * grid_h * grid_w,
|
| 193 |
+
channel * temporal_patch_size * patch_size * patch_size,
|
| 194 |
+
)
|
| 195 |
+
|
| 196 |
+
processed_images_grouped[shape] = flatten_patches
|
| 197 |
+
processed_grids[shape] = [[grid_t, grid_h, grid_w]] * batch_size
|
| 198 |
+
|
| 199 |
+
processed_images = reorder_images(
|
| 200 |
+
processed_images_grouped, grouped_images_index
|
| 201 |
+
)
|
| 202 |
+
processed_grids = reorder_images(processed_grids, grouped_images_index)
|
| 203 |
+
|
| 204 |
+
pixel_values = torch.cat(processed_images, dim=0)
|
| 205 |
+
image_grid_thw = torch.tensor(processed_grids, dtype=torch.long)
|
| 206 |
+
|
| 207 |
+
return BatchFeature(
|
| 208 |
+
data={"pixel_values": pixel_values, "image_grid_thw": image_grid_thw},
|
| 209 |
+
tensor_type=return_tensors,
|
| 210 |
+
)
|
| 211 |
+
|
| 212 |
+
def get_number_of_image_patches(self, height: int, width: int, images_kwargs=None):
|
| 213 |
+
images_kwargs = images_kwargs or {}
|
| 214 |
+
patch_size = images_kwargs.get("patch_size", self.patch_size)
|
| 215 |
+
merge_size = images_kwargs.get("merge_size", self.merge_size)
|
| 216 |
+
max_pixels = images_kwargs.get("max_pixels", self.max_pixels)
|
| 217 |
+
|
| 218 |
+
resized_height, resized_width = smart_resize(
|
| 219 |
+
height, width, factor=patch_size * merge_size,
|
| 220 |
+
max_pixels=max_pixels,
|
| 221 |
+
)
|
| 222 |
+
grid_h, grid_w = resized_height // patch_size, resized_width // patch_size
|
| 223 |
+
return grid_h * grid_w
|
merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
model-00002-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bed9618e65d4da049fd736d29d2667815d67448c2f1a800c3dc1b8432ef8c759
|
| 3 |
+
size 2837318800
|
model-00003-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4f40b1d30fd1f82e5980f6fb38b20689783c4988db866530ad5ec0763802d847
|
| 3 |
+
size 4179411728
|
model-00004-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:70393ae1998307de92671d4460a47d564b6ec27d4edd6992ddb41c26909ad345
|
| 3 |
+
size 4179411720
|
model-00005-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:680b2ea12e9f2b0085758eb594b261c7283857f07fb5683479fb37494ab53a6b
|
| 3 |
+
size 4179411720
|
model-00008-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:06b0ee9327050e5249775ec6a2c020fe08e1df062d9061fea8d3e9761dcba6a5
|
| 3 |
+
size 4179411720
|
model-00009-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e3d983c7f3e9e244bdd18633e71fd1e29964dfad4e576236b0a0568eae3f281a
|
| 3 |
+
size 4179411720
|
model-00010-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f1ae7bd8821639542c41a1b75fb046644a0fcf98f57f55a08b6827b1d56aca56
|
| 3 |
+
size 4179412912
|
model-00012-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:39a00a59eabfa5d6d4e551dd9af6e04e401f8bb35b418905e919e4f9680bd422
|
| 3 |
+
size 4179412912
|
model-00013-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b53e684bec360279aec2142787acab9cef8499ae5ea7357d3426a629407a93a7
|
| 3 |
+
size 4179412912
|
model-00014-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c8becbbd9331f3cd086fb3015c37124be4be42be0cac1aaa8c331c203570ca8f
|
| 3 |
+
size 4179412912
|
model-00015-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0942588c2f863fde247ca80f9b0f853891d9070c2c94e8a72388f1725479b25a
|
| 3 |
+
size 4179412912
|
model-00018-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:83cbba1a9fbc1be7297563800c5c8db0a8fcfe0901a175667980c23c5a323395
|
| 3 |
+
size 4179412912
|
model-00019-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:202d83f87963853a3aed6d1ff507dcf97213432cdf64602d42fd37e4ba8449ba
|
| 3 |
+
size 4179412912
|
model-00020-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:994eae9a774400881525dac6e116476d187e6d61bcd7213ec73c19273bb3a0af
|
| 3 |
+
size 4179412912
|
model-00021-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2e4e628ea85bcdd9095ad21749ba7b02a34420423ebb1c30026ace1fe74a40ae
|
| 3 |
+
size 4179412912
|
model-00026-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:35d1699505cbe9935154265c5df47f83bef64f982682f748219d37ac9528c3ff
|
| 3 |
+
size 4324556832
|
model-00027-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:759a130dd22a1918bca77f544b1cdf9c399dd0cc389d85630198876ba49a8994
|
| 3 |
+
size 3855805728
|
model-00030-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9eeba18e6cd72fa0a08f19bd5ccb3f04221db0ebd43620d76cbe1a8ff43db33c
|
| 3 |
+
size 3855805728
|
model-00031-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:33889f941a05141af1e3f608b2e0f7d2e7191c7527cdbc5413a57b3269818763
|
| 3 |
+
size 3855805728
|
model-00036-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:201f15f47fbe7a66b79c2d41e781156e0ae5f944939d24a18cfb18ab0a901004
|
| 3 |
+
size 3855805728
|
model-00037-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:be1e7459280e21c37ae1242463fbc9a5b211fdc9fd3b702d486f612beee861fb
|
| 3 |
+
size 3532198552
|
model-00040-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6e30e5a352926fcab85ac8f8595a9486bf55f4227351262035241a55f2422c8e
|
| 3 |
+
size 3532198552
|
model-00041-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:de81e70f5a43df6b3d911976da15bb67f31c1f01b6da3218f70fc438b14fc0a3
|
| 3 |
+
size 3532198552
|
model-00046-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0c41d45fc404dd84058434de3f24676dd2a67fa2a475e3b74dd540241c41f78d
|
| 3 |
+
size 3532198552
|
model-00047-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2ccc6ff1870aca3cba9f3853946b706c706167313d4f4b8c19f76b17688d9f3b
|
| 3 |
+
size 3532198552
|
model-00050-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d7a37967718558f473ce9cd03a9d989cc9f5d589e6e29610d9c5d86caa27b2b2
|
| 3 |
+
size 3532198552
|
model-00051-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b3c0e8ec00cdfb6889d15e51b46124248865dc658ecb93e96411e6f9c8e5aea5
|
| 3 |
+
size 3532198552
|
model-00056-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:91523ae250a0d81ffe1bf95f64be48e6fa5373c4fb8d10e9e200fad5a65778c9
|
| 3 |
+
size 3532198552
|
model-00057-of-00059.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:13b9049accdc60f7cf5c2be97db2be2e3be330a1c0f63c72b7121b37e32e2ae8
|
| 3 |
+
size 3532198552
|
model.safetensors.index.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"processor_class": "MiniMaxVLProcessor",
|
| 3 |
+
"auto_map": {
|
| 4 |
+
"AutoImageProcessor": "image_processor.MiniMaxM3VLImageProcessor",
|
| 5 |
+
"AutoProcessor": "processing_minimax.MiniMaxVLProcessor",
|
| 6 |
+
"AutoVideoProcessor": "video_processor.MiniMaxM3VLVideoProcessor"
|
| 7 |
+
},
|
| 8 |
+
"process_image_mode": "dynamic_res",
|
| 9 |
+
"image_mean": [
|
| 10 |
+
0.48145466,
|
| 11 |
+
0.4578275,
|
| 12 |
+
0.40821073
|
| 13 |
+
],
|
| 14 |
+
"image_std": [
|
| 15 |
+
0.26862954,
|
| 16 |
+
0.26130258,
|
| 17 |
+
0.27577711
|
| 18 |
+
],
|
| 19 |
+
"size": [
|
| 20 |
+
672,
|
| 21 |
+
672
|
| 22 |
+
],
|
| 23 |
+
"patch_size": 14,
|
| 24 |
+
"img_token_compression_config": {
|
| 25 |
+
"image_token_compression_threshold": 1.1,
|
| 26 |
+
"image_token_compression_method": "patch_merge",
|
| 27 |
+
"max_image_resolution": 1008,
|
| 28 |
+
"spatial_merge_size": 2,
|
| 29 |
+
"temporal_patch_size": 2
|
| 30 |
+
},
|
| 31 |
+
"add_start_end_special_tokens": true
|
| 32 |
+
}
|
processing_minimax.py
ADDED
|
@@ -0,0 +1,254 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright 2023-2024 SGLang Team
|
| 2 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 3 |
+
"""
|
| 4 |
+
MiniMax VL family HuggingFace-compatible Processor, ImageProcessor, VideoProcessor.
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
import math
|
| 8 |
+
import re
|
| 9 |
+
from typing import List, Optional, Tuple, Union
|
| 10 |
+
|
| 11 |
+
import torch
|
| 12 |
+
import torchvision
|
| 13 |
+
from torchvision.transforms import InterpolationMode
|
| 14 |
+
from transformers import BatchFeature
|
| 15 |
+
from transformers.image_processing_utils_fast import (
|
| 16 |
+
BaseImageProcessorFast,
|
| 17 |
+
group_images_by_shape,
|
| 18 |
+
reorder_images,
|
| 19 |
+
)
|
| 20 |
+
from transformers.image_utils import PILImageResampling, SizeDict
|
| 21 |
+
from transformers.processing_utils import (
|
| 22 |
+
ImagesKwargs,
|
| 23 |
+
ProcessingKwargs,
|
| 24 |
+
ProcessorMixin,
|
| 25 |
+
Unpack,
|
| 26 |
+
VideosKwargs,
|
| 27 |
+
)
|
| 28 |
+
from transformers.utils import TensorType
|
| 29 |
+
from transformers.video_processing_utils import BaseVideoProcessor
|
| 30 |
+
from transformers.video_utils import group_videos_by_shape, reorder_videos
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
class MiniMaxVLProcessorKwargs(ProcessingKwargs, total=False):
|
| 34 |
+
_defaults = {
|
| 35 |
+
"videos_kwargs": {
|
| 36 |
+
"do_resize": False,
|
| 37 |
+
"return_metadata": True,
|
| 38 |
+
},
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
class MiniMaxVLProcessor(ProcessorMixin):
|
| 43 |
+
IMAGE_TOKEN = "]<]image[>["
|
| 44 |
+
VIDEO_TOKEN = "]<]video[>["
|
| 45 |
+
VISION_START_TOKEN = "]<]start of image[>["
|
| 46 |
+
VISION_END_TOKEN = "]<]end of image[>["
|
| 47 |
+
|
| 48 |
+
def __init__(
|
| 49 |
+
self, image_processor=None, tokenizer=None, video_processor=None, **kwargs
|
| 50 |
+
):
|
| 51 |
+
self.image_token_id = tokenizer.convert_tokens_to_ids(self.IMAGE_TOKEN)
|
| 52 |
+
self.video_token_id = tokenizer.convert_tokens_to_ids(self.VIDEO_TOKEN)
|
| 53 |
+
super().__init__(image_processor, tokenizer, video_processor)
|
| 54 |
+
# Video expansion also uses image start/end tokens. Separate video
|
| 55 |
+
# start/end tokens exist in the tokenizer, but the original MiniMax
|
| 56 |
+
# serving path did not use them; keep that behavior for compatibility.
|
| 57 |
+
self.vision_start_token_id = tokenizer.convert_tokens_to_ids(
|
| 58 |
+
self.VISION_START_TOKEN
|
| 59 |
+
)
|
| 60 |
+
self.vision_end_token_id = tokenizer.convert_tokens_to_ids(
|
| 61 |
+
self.VISION_END_TOKEN
|
| 62 |
+
)
|
| 63 |
+
|
| 64 |
+
def _prune_video_tokens(
|
| 65 |
+
self,
|
| 66 |
+
input_text: str,
|
| 67 |
+
video_segments: List[int],
|
| 68 |
+
video_token: str,
|
| 69 |
+
) -> str:
|
| 70 |
+
"""
|
| 71 |
+
Prune video tokens by temporal_patch_size (e.g., 2:1).
|
| 72 |
+
|
| 73 |
+
Expects the prompt to carry exactly sum(video_segments) video
|
| 74 |
+
tokens — i.e. one token per *sampled* frame. Then drops token.
|
| 75 |
+
|
| 76 |
+
Args:
|
| 77 |
+
input_text: prompt with N video_tokens per segment
|
| 78 |
+
video_segments: actual sampled frame count per video segment
|
| 79 |
+
video_token: the video token string, e.g. ']<]video[>['
|
| 80 |
+
|
| 81 |
+
Returns:
|
| 82 |
+
Pruned input_text with ~N/temporal_patch_size tokens per segment.
|
| 83 |
+
"""
|
| 84 |
+
# If no videos or temporal_patch_size <= 1, no pruning needed
|
| 85 |
+
if not video_segments or self.video_processor.temporal_patch_size <= 1:
|
| 86 |
+
return input_text
|
| 87 |
+
|
| 88 |
+
# Split while keeping delimiters
|
| 89 |
+
special_tokens = [video_token] # , image_token]
|
| 90 |
+
pattern = "|".join(map(re.escape, special_tokens))
|
| 91 |
+
parts = re.split(f"({pattern})", input_text)
|
| 92 |
+
|
| 93 |
+
def is_timestamp(text: str) -> bool:
|
| 94 |
+
"""Check if text ends with timestamp format like ']<]0.0 seconds[>['"""
|
| 95 |
+
return (
|
| 96 |
+
text.endswith("seconds[>[")
|
| 97 |
+
or text.endswith("seconds[>[ ")
|
| 98 |
+
or text.endswith("seconds [>[")
|
| 99 |
+
or text.endswith("seconds [>[ ")
|
| 100 |
+
)
|
| 101 |
+
|
| 102 |
+
def extract_timestamp(text: str) -> str:
|
| 103 |
+
"""Extract timestamp text from the end, starting from ']<]'"""
|
| 104 |
+
start_index = text.rfind("]<]")
|
| 105 |
+
if start_index == -1:
|
| 106 |
+
raise ValueError(f"Failed to extract timestamp: {text}")
|
| 107 |
+
return text[start_index:]
|
| 108 |
+
|
| 109 |
+
# Build new text with pruned video tokens
|
| 110 |
+
final_parts = []
|
| 111 |
+
current_seg_idx = 0 # Which video segment we're in
|
| 112 |
+
frame_in_seg = 0 # Frame index within current segment
|
| 113 |
+
last_timestamp_len = 0 # Length of timestamp to potentially remove
|
| 114 |
+
|
| 115 |
+
for part in parts:
|
| 116 |
+
if part == video_token:
|
| 117 |
+
if current_seg_idx < len(video_segments):
|
| 118 |
+
if frame_in_seg % self.video_processor.temporal_patch_size == 0:
|
| 119 |
+
# Keep this video token
|
| 120 |
+
final_parts.append(part)
|
| 121 |
+
frame_in_seg += 1
|
| 122 |
+
if frame_in_seg >= video_segments[current_seg_idx]:
|
| 123 |
+
current_seg_idx += 1
|
| 124 |
+
frame_in_seg = 0
|
| 125 |
+
last_timestamp_len = 0
|
| 126 |
+
else:
|
| 127 |
+
# Skip this video token
|
| 128 |
+
frame_in_seg += 1
|
| 129 |
+
if frame_in_seg >= video_segments[current_seg_idx]:
|
| 130 |
+
current_seg_idx += 1
|
| 131 |
+
frame_in_seg = 0
|
| 132 |
+
# Remove the timestamp that was already appended
|
| 133 |
+
if last_timestamp_len > 0:
|
| 134 |
+
# Truncate the last part to remove timestamp
|
| 135 |
+
assert len(final_parts) > 0
|
| 136 |
+
final_parts[-1] = final_parts[-1][:-last_timestamp_len]
|
| 137 |
+
last_timestamp_len = 0
|
| 138 |
+
else:
|
| 139 |
+
# No more video segments, keep as is
|
| 140 |
+
final_parts.append(part)
|
| 141 |
+
last_timestamp_len = 0
|
| 142 |
+
else:
|
| 143 |
+
# Text part
|
| 144 |
+
final_parts.append(part)
|
| 145 |
+
# Check if this text ends with a timestamp
|
| 146 |
+
if is_timestamp(part):
|
| 147 |
+
last_timestamp_len = len(extract_timestamp(part))
|
| 148 |
+
else:
|
| 149 |
+
last_timestamp_len = 0
|
| 150 |
+
|
| 151 |
+
return "".join(final_parts)
|
| 152 |
+
|
| 153 |
+
def __call__(
|
| 154 |
+
self,
|
| 155 |
+
images=None,
|
| 156 |
+
text=None,
|
| 157 |
+
videos=None,
|
| 158 |
+
**kwargs: Unpack[MiniMaxVLProcessorKwargs],
|
| 159 |
+
) -> BatchFeature:
|
| 160 |
+
output_kwargs = self._merge_kwargs(
|
| 161 |
+
MiniMaxVLProcessorKwargs,
|
| 162 |
+
tokenizer_init_kwargs=self.tokenizer.init_kwargs,
|
| 163 |
+
**kwargs,
|
| 164 |
+
)
|
| 165 |
+
|
| 166 |
+
if images is not None:
|
| 167 |
+
images_kwargs = output_kwargs["images_kwargs"]
|
| 168 |
+
image_inputs = self.image_processor(images=images, **images_kwargs)
|
| 169 |
+
image_grid_thw = image_inputs["image_grid_thw"]
|
| 170 |
+
|
| 171 |
+
else:
|
| 172 |
+
image_inputs = {}
|
| 173 |
+
image_grid_thw = None
|
| 174 |
+
|
| 175 |
+
if videos is not None:
|
| 176 |
+
videos_kwargs = output_kwargs["videos_kwargs"]
|
| 177 |
+
video_inputs = self.video_processor(videos=videos, **videos_kwargs)
|
| 178 |
+
video_grid_thw = video_inputs["video_grid_thw"]
|
| 179 |
+
if not kwargs.get("return_metadata"):
|
| 180 |
+
video_metadata = video_inputs.pop("video_metadata")
|
| 181 |
+
else:
|
| 182 |
+
video_metadata = video_inputs["video_metadata"]
|
| 183 |
+
else:
|
| 184 |
+
video_inputs = {}
|
| 185 |
+
video_grid_thw = None
|
| 186 |
+
|
| 187 |
+
if not isinstance(text, list):
|
| 188 |
+
text = [text]
|
| 189 |
+
text = text.copy()
|
| 190 |
+
|
| 191 |
+
# Expand image tokens
|
| 192 |
+
if image_grid_thw is not None:
|
| 193 |
+
merge_length = self.image_processor.merge_size**2
|
| 194 |
+
placeholder = "]<]placeholder[>["
|
| 195 |
+
index = 0
|
| 196 |
+
for i in range(len(text)):
|
| 197 |
+
while self.IMAGE_TOKEN in text[i]:
|
| 198 |
+
num_tokens = image_grid_thw[index].prod() // merge_length
|
| 199 |
+
text[i] = text[i].replace(
|
| 200 |
+
self.IMAGE_TOKEN,
|
| 201 |
+
self.VISION_START_TOKEN
|
| 202 |
+
+ placeholder * num_tokens
|
| 203 |
+
+ self.VISION_END_TOKEN,
|
| 204 |
+
1,
|
| 205 |
+
)
|
| 206 |
+
index += 1
|
| 207 |
+
text[i] = text[i].replace(placeholder, self.IMAGE_TOKEN)
|
| 208 |
+
|
| 209 |
+
# Expand video tokens
|
| 210 |
+
if video_grid_thw is not None:
|
| 211 |
+
merge_length = self.image_processor.merge_size**2
|
| 212 |
+
placeholder = "]<]placeholder[>["
|
| 213 |
+
index = 0
|
| 214 |
+
for i in range(len(text)):
|
| 215 |
+
while self.VIDEO_TOKEN in text[i]:
|
| 216 |
+
metadata = video_metadata[index]
|
| 217 |
+
grid_t = video_grid_thw[index][0]
|
| 218 |
+
frame_seqlen = video_grid_thw[index][1:].prod() // merge_length
|
| 219 |
+
|
| 220 |
+
video_placeholder = ""
|
| 221 |
+
for frame_idx in range(grid_t):
|
| 222 |
+
if (
|
| 223 |
+
metadata.fps is not None
|
| 224 |
+
and metadata.frames_indices is not None
|
| 225 |
+
):
|
| 226 |
+
ts = (
|
| 227 |
+
metadata.frames_indices[
|
| 228 |
+
min(
|
| 229 |
+
frame_idx
|
| 230 |
+
* self.video_processor.temporal_patch_size,
|
| 231 |
+
len(metadata.frames_indices) - 1,
|
| 232 |
+
)
|
| 233 |
+
]
|
| 234 |
+
/ metadata.fps
|
| 235 |
+
)
|
| 236 |
+
video_placeholder += f"]<]{ts:.1f} seconds[>["
|
| 237 |
+
video_placeholder += (
|
| 238 |
+
self.VISION_START_TOKEN
|
| 239 |
+
+ placeholder * frame_seqlen
|
| 240 |
+
+ self.VISION_END_TOKEN
|
| 241 |
+
)
|
| 242 |
+
|
| 243 |
+
text[i] = text[i].replace(self.VIDEO_TOKEN, video_placeholder, 1)
|
| 244 |
+
index += 1
|
| 245 |
+
text[i] = text[i].replace(placeholder, self.VIDEO_TOKEN)
|
| 246 |
+
|
| 247 |
+
# Tokenize
|
| 248 |
+
return_tensors = output_kwargs["text_kwargs"].pop("return_tensors", None)
|
| 249 |
+
text_inputs = self.tokenizer(text, **output_kwargs["text_kwargs"])
|
| 250 |
+
|
| 251 |
+
return BatchFeature(
|
| 252 |
+
data={**text_inputs, **image_inputs, **video_inputs},
|
| 253 |
+
tensor_type=return_tensors,
|
| 254 |
+
)
|
quantization_config.json
ADDED
|
@@ -0,0 +1,1033 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"quant_method": "auto-round",
|
| 3 |
+
"packing_format": "auto_round:auto_gptq",
|
| 4 |
+
"bits": 4,
|
| 5 |
+
"group_size": 128,
|
| 6 |
+
"sym": true,
|
| 7 |
+
"data_type": "int",
|
| 8 |
+
"iters": 0,
|
| 9 |
+
"model_free": true,
|
| 10 |
+
"autoround_version": "0.14.0",
|
| 11 |
+
"extra_config": {
|
| 12 |
+
"language_model.lm_head": {
|
| 13 |
+
"bits": 16,
|
| 14 |
+
"data_type": "float"
|
| 15 |
+
},
|
| 16 |
+
"language_model.model.embed_tokens": {
|
| 17 |
+
"bits": 16,
|
| 18 |
+
"data_type": "float"
|
| 19 |
+
},
|
| 20 |
+
"language_model.model.layers.3.block_sparse_moe.gate": {
|
| 21 |
+
"bits": 16,
|
| 22 |
+
"data_type": "float"
|
| 23 |
+
},
|
| 24 |
+
"language_model.model.layers.4.block_sparse_moe.gate": {
|
| 25 |
+
"bits": 16,
|
| 26 |
+
"data_type": "float"
|
| 27 |
+
},
|
| 28 |
+
"language_model.model.layers.5.block_sparse_moe.gate": {
|
| 29 |
+
"bits": 16,
|
| 30 |
+
"data_type": "float"
|
| 31 |
+
},
|
| 32 |
+
"language_model.model.layers.6.block_sparse_moe.gate": {
|
| 33 |
+
"bits": 16,
|
| 34 |
+
"data_type": "float"
|
| 35 |
+
},
|
| 36 |
+
"language_model.model.layers.7.block_sparse_moe.gate": {
|
| 37 |
+
"bits": 16,
|
| 38 |
+
"data_type": "float"
|
| 39 |
+
},
|
| 40 |
+
"language_model.model.layers.8.block_sparse_moe.gate": {
|
| 41 |
+
"bits": 16,
|
| 42 |
+
"data_type": "float"
|
| 43 |
+
},
|
| 44 |
+
"language_model.model.layers.9.block_sparse_moe.gate": {
|
| 45 |
+
"bits": 16,
|
| 46 |
+
"data_type": "float"
|
| 47 |
+
},
|
| 48 |
+
"language_model.model.layers.10.block_sparse_moe.gate": {
|
| 49 |
+
"bits": 16,
|
| 50 |
+
"data_type": "float"
|
| 51 |
+
},
|
| 52 |
+
"language_model.model.layers.11.block_sparse_moe.gate": {
|
| 53 |
+
"bits": 16,
|
| 54 |
+
"data_type": "float"
|
| 55 |
+
},
|
| 56 |
+
"language_model.model.layers.12.block_sparse_moe.gate": {
|
| 57 |
+
"bits": 16,
|
| 58 |
+
"data_type": "float"
|
| 59 |
+
},
|
| 60 |
+
"language_model.model.layers.13.block_sparse_moe.gate": {
|
| 61 |
+
"bits": 16,
|
| 62 |
+
"data_type": "float"
|
| 63 |
+
},
|
| 64 |
+
"language_model.model.layers.14.block_sparse_moe.gate": {
|
| 65 |
+
"bits": 16,
|
| 66 |
+
"data_type": "float"
|
| 67 |
+
},
|
| 68 |
+
"language_model.model.layers.15.block_sparse_moe.gate": {
|
| 69 |
+
"bits": 16,
|
| 70 |
+
"data_type": "float"
|
| 71 |
+
},
|
| 72 |
+
"language_model.model.layers.16.block_sparse_moe.gate": {
|
| 73 |
+
"bits": 16,
|
| 74 |
+
"data_type": "float"
|
| 75 |
+
},
|
| 76 |
+
"language_model.model.layers.17.block_sparse_moe.gate": {
|
| 77 |
+
"bits": 16,
|
| 78 |
+
"data_type": "float"
|
| 79 |
+
},
|
| 80 |
+
"language_model.model.layers.18.block_sparse_moe.gate": {
|
| 81 |
+
"bits": 16,
|
| 82 |
+
"data_type": "float"
|
| 83 |
+
},
|
| 84 |
+
"language_model.model.layers.19.block_sparse_moe.gate": {
|
| 85 |
+
"bits": 16,
|
| 86 |
+
"data_type": "float"
|
| 87 |
+
},
|
| 88 |
+
"language_model.model.layers.20.block_sparse_moe.gate": {
|
| 89 |
+
"bits": 16,
|
| 90 |
+
"data_type": "float"
|
| 91 |
+
},
|
| 92 |
+
"language_model.model.layers.21.block_sparse_moe.gate": {
|
| 93 |
+
"bits": 16,
|
| 94 |
+
"data_type": "float"
|
| 95 |
+
},
|
| 96 |
+
"language_model.model.layers.22.block_sparse_moe.gate": {
|
| 97 |
+
"bits": 16,
|
| 98 |
+
"data_type": "float"
|
| 99 |
+
},
|
| 100 |
+
"language_model.model.layers.23.block_sparse_moe.gate": {
|
| 101 |
+
"bits": 16,
|
| 102 |
+
"data_type": "float"
|
| 103 |
+
},
|
| 104 |
+
"language_model.model.layers.24.block_sparse_moe.gate": {
|
| 105 |
+
"bits": 16,
|
| 106 |
+
"data_type": "float"
|
| 107 |
+
},
|
| 108 |
+
"language_model.model.layers.25.block_sparse_moe.gate": {
|
| 109 |
+
"bits": 16,
|
| 110 |
+
"data_type": "float"
|
| 111 |
+
},
|
| 112 |
+
"language_model.model.layers.26.block_sparse_moe.gate": {
|
| 113 |
+
"bits": 16,
|
| 114 |
+
"data_type": "float"
|
| 115 |
+
},
|
| 116 |
+
"language_model.model.layers.27.block_sparse_moe.gate": {
|
| 117 |
+
"bits": 16,
|
| 118 |
+
"data_type": "float"
|
| 119 |
+
},
|
| 120 |
+
"language_model.model.layers.28.block_sparse_moe.gate": {
|
| 121 |
+
"bits": 16,
|
| 122 |
+
"data_type": "float"
|
| 123 |
+
},
|
| 124 |
+
"language_model.model.layers.29.block_sparse_moe.gate": {
|
| 125 |
+
"bits": 16,
|
| 126 |
+
"data_type": "float"
|
| 127 |
+
},
|
| 128 |
+
"language_model.model.layers.30.block_sparse_moe.gate": {
|
| 129 |
+
"bits": 16,
|
| 130 |
+
"data_type": "float"
|
| 131 |
+
},
|
| 132 |
+
"language_model.model.layers.31.block_sparse_moe.gate": {
|
| 133 |
+
"bits": 16,
|
| 134 |
+
"data_type": "float"
|
| 135 |
+
},
|
| 136 |
+
"language_model.model.layers.32.block_sparse_moe.gate": {
|
| 137 |
+
"bits": 16,
|
| 138 |
+
"data_type": "float"
|
| 139 |
+
},
|
| 140 |
+
"language_model.model.layers.33.block_sparse_moe.gate": {
|
| 141 |
+
"bits": 16,
|
| 142 |
+
"data_type": "float"
|
| 143 |
+
},
|
| 144 |
+
"language_model.model.layers.34.block_sparse_moe.gate": {
|
| 145 |
+
"bits": 16,
|
| 146 |
+
"data_type": "float"
|
| 147 |
+
},
|
| 148 |
+
"language_model.model.layers.35.block_sparse_moe.gate": {
|
| 149 |
+
"bits": 16,
|
| 150 |
+
"data_type": "float"
|
| 151 |
+
},
|
| 152 |
+
"language_model.model.layers.36.block_sparse_moe.gate": {
|
| 153 |
+
"bits": 16,
|
| 154 |
+
"data_type": "float"
|
| 155 |
+
},
|
| 156 |
+
"language_model.model.layers.37.block_sparse_moe.gate": {
|
| 157 |
+
"bits": 16,
|
| 158 |
+
"data_type": "float"
|
| 159 |
+
},
|
| 160 |
+
"language_model.model.layers.38.block_sparse_moe.gate": {
|
| 161 |
+
"bits": 16,
|
| 162 |
+
"data_type": "float"
|
| 163 |
+
},
|
| 164 |
+
"language_model.model.layers.39.block_sparse_moe.gate": {
|
| 165 |
+
"bits": 16,
|
| 166 |
+
"data_type": "float"
|
| 167 |
+
},
|
| 168 |
+
"language_model.model.layers.40.block_sparse_moe.gate": {
|
| 169 |
+
"bits": 16,
|
| 170 |
+
"data_type": "float"
|
| 171 |
+
},
|
| 172 |
+
"language_model.model.layers.41.block_sparse_moe.gate": {
|
| 173 |
+
"bits": 16,
|
| 174 |
+
"data_type": "float"
|
| 175 |
+
},
|
| 176 |
+
"language_model.model.layers.42.block_sparse_moe.gate": {
|
| 177 |
+
"bits": 16,
|
| 178 |
+
"data_type": "float"
|
| 179 |
+
},
|
| 180 |
+
"language_model.model.layers.43.block_sparse_moe.gate": {
|
| 181 |
+
"bits": 16,
|
| 182 |
+
"data_type": "float"
|
| 183 |
+
},
|
| 184 |
+
"language_model.model.layers.44.block_sparse_moe.gate": {
|
| 185 |
+
"bits": 16,
|
| 186 |
+
"data_type": "float"
|
| 187 |
+
},
|
| 188 |
+
"language_model.model.layers.45.block_sparse_moe.gate": {
|
| 189 |
+
"bits": 16,
|
| 190 |
+
"data_type": "float"
|
| 191 |
+
},
|
| 192 |
+
"language_model.model.layers.46.block_sparse_moe.gate": {
|
| 193 |
+
"bits": 16,
|
| 194 |
+
"data_type": "float"
|
| 195 |
+
},
|
| 196 |
+
"language_model.model.layers.47.block_sparse_moe.gate": {
|
| 197 |
+
"bits": 16,
|
| 198 |
+
"data_type": "float"
|
| 199 |
+
},
|
| 200 |
+
"language_model.model.layers.48.block_sparse_moe.gate": {
|
| 201 |
+
"bits": 16,
|
| 202 |
+
"data_type": "float"
|
| 203 |
+
},
|
| 204 |
+
"language_model.model.layers.49.block_sparse_moe.gate": {
|
| 205 |
+
"bits": 16,
|
| 206 |
+
"data_type": "float"
|
| 207 |
+
},
|
| 208 |
+
"language_model.model.layers.50.block_sparse_moe.gate": {
|
| 209 |
+
"bits": 16,
|
| 210 |
+
"data_type": "float"
|
| 211 |
+
},
|
| 212 |
+
"language_model.model.layers.51.block_sparse_moe.gate": {
|
| 213 |
+
"bits": 16,
|
| 214 |
+
"data_type": "float"
|
| 215 |
+
},
|
| 216 |
+
"language_model.model.layers.52.block_sparse_moe.gate": {
|
| 217 |
+
"bits": 16,
|
| 218 |
+
"data_type": "float"
|
| 219 |
+
},
|
| 220 |
+
"language_model.model.layers.53.block_sparse_moe.gate": {
|
| 221 |
+
"bits": 16,
|
| 222 |
+
"data_type": "float"
|
| 223 |
+
},
|
| 224 |
+
"language_model.model.layers.54.block_sparse_moe.gate": {
|
| 225 |
+
"bits": 16,
|
| 226 |
+
"data_type": "float"
|
| 227 |
+
},
|
| 228 |
+
"language_model.model.layers.55.block_sparse_moe.gate": {
|
| 229 |
+
"bits": 16,
|
| 230 |
+
"data_type": "float"
|
| 231 |
+
},
|
| 232 |
+
"language_model.model.layers.56.block_sparse_moe.gate": {
|
| 233 |
+
"bits": 16,
|
| 234 |
+
"data_type": "float"
|
| 235 |
+
},
|
| 236 |
+
"language_model.model.layers.57.block_sparse_moe.gate": {
|
| 237 |
+
"bits": 16,
|
| 238 |
+
"data_type": "float"
|
| 239 |
+
},
|
| 240 |
+
"language_model.model.layers.58.block_sparse_moe.gate": {
|
| 241 |
+
"bits": 16,
|
| 242 |
+
"data_type": "float"
|
| 243 |
+
},
|
| 244 |
+
"language_model.model.layers.59.block_sparse_moe.gate": {
|
| 245 |
+
"bits": 16,
|
| 246 |
+
"data_type": "float"
|
| 247 |
+
},
|
| 248 |
+
"vision_tower.vision_model.encoder.layers.0.mlp.fc1": {
|
| 249 |
+
"bits": 16,
|
| 250 |
+
"data_type": "float"
|
| 251 |
+
},
|
| 252 |
+
"vision_tower.vision_model.encoder.layers.0.mlp.fc2": {
|
| 253 |
+
"bits": 16,
|
| 254 |
+
"data_type": "float"
|
| 255 |
+
},
|
| 256 |
+
"vision_tower.vision_model.encoder.layers.0.self_attn.k_proj": {
|
| 257 |
+
"bits": 16,
|
| 258 |
+
"data_type": "float"
|
| 259 |
+
},
|
| 260 |
+
"vision_tower.vision_model.encoder.layers.0.self_attn.out_proj": {
|
| 261 |
+
"bits": 16,
|
| 262 |
+
"data_type": "float"
|
| 263 |
+
},
|
| 264 |
+
"vision_tower.vision_model.encoder.layers.0.self_attn.q_proj": {
|
| 265 |
+
"bits": 16,
|
| 266 |
+
"data_type": "float"
|
| 267 |
+
},
|
| 268 |
+
"vision_tower.vision_model.encoder.layers.0.self_attn.v_proj": {
|
| 269 |
+
"bits": 16,
|
| 270 |
+
"data_type": "float"
|
| 271 |
+
},
|
| 272 |
+
"vision_tower.vision_model.encoder.layers.1.mlp.fc1": {
|
| 273 |
+
"bits": 16,
|
| 274 |
+
"data_type": "float"
|
| 275 |
+
},
|
| 276 |
+
"vision_tower.vision_model.encoder.layers.1.mlp.fc2": {
|
| 277 |
+
"bits": 16,
|
| 278 |
+
"data_type": "float"
|
| 279 |
+
},
|
| 280 |
+
"vision_tower.vision_model.encoder.layers.1.self_attn.k_proj": {
|
| 281 |
+
"bits": 16,
|
| 282 |
+
"data_type": "float"
|
| 283 |
+
},
|
| 284 |
+
"vision_tower.vision_model.encoder.layers.1.self_attn.out_proj": {
|
| 285 |
+
"bits": 16,
|
| 286 |
+
"data_type": "float"
|
| 287 |
+
},
|
| 288 |
+
"vision_tower.vision_model.encoder.layers.1.self_attn.q_proj": {
|
| 289 |
+
"bits": 16,
|
| 290 |
+
"data_type": "float"
|
| 291 |
+
},
|
| 292 |
+
"vision_tower.vision_model.encoder.layers.1.self_attn.v_proj": {
|
| 293 |
+
"bits": 16,
|
| 294 |
+
"data_type": "float"
|
| 295 |
+
},
|
| 296 |
+
"vision_tower.vision_model.encoder.layers.10.mlp.fc1": {
|
| 297 |
+
"bits": 16,
|
| 298 |
+
"data_type": "float"
|
| 299 |
+
},
|
| 300 |
+
"vision_tower.vision_model.encoder.layers.10.mlp.fc2": {
|
| 301 |
+
"bits": 16,
|
| 302 |
+
"data_type": "float"
|
| 303 |
+
},
|
| 304 |
+
"vision_tower.vision_model.encoder.layers.10.self_attn.k_proj": {
|
| 305 |
+
"bits": 16,
|
| 306 |
+
"data_type": "float"
|
| 307 |
+
},
|
| 308 |
+
"vision_tower.vision_model.encoder.layers.10.self_attn.out_proj": {
|
| 309 |
+
"bits": 16,
|
| 310 |
+
"data_type": "float"
|
| 311 |
+
},
|
| 312 |
+
"vision_tower.vision_model.encoder.layers.10.self_attn.q_proj": {
|
| 313 |
+
"bits": 16,
|
| 314 |
+
"data_type": "float"
|
| 315 |
+
},
|
| 316 |
+
"vision_tower.vision_model.encoder.layers.10.self_attn.v_proj": {
|
| 317 |
+
"bits": 16,
|
| 318 |
+
"data_type": "float"
|
| 319 |
+
},
|
| 320 |
+
"vision_tower.vision_model.encoder.layers.11.mlp.fc1": {
|
| 321 |
+
"bits": 16,
|
| 322 |
+
"data_type": "float"
|
| 323 |
+
},
|
| 324 |
+
"vision_tower.vision_model.encoder.layers.11.mlp.fc2": {
|
| 325 |
+
"bits": 16,
|
| 326 |
+
"data_type": "float"
|
| 327 |
+
},
|
| 328 |
+
"vision_tower.vision_model.encoder.layers.11.self_attn.k_proj": {
|
| 329 |
+
"bits": 16,
|
| 330 |
+
"data_type": "float"
|
| 331 |
+
},
|
| 332 |
+
"vision_tower.vision_model.encoder.layers.11.self_attn.out_proj": {
|
| 333 |
+
"bits": 16,
|
| 334 |
+
"data_type": "float"
|
| 335 |
+
},
|
| 336 |
+
"vision_tower.vision_model.encoder.layers.11.self_attn.q_proj": {
|
| 337 |
+
"bits": 16,
|
| 338 |
+
"data_type": "float"
|
| 339 |
+
},
|
| 340 |
+
"vision_tower.vision_model.encoder.layers.11.self_attn.v_proj": {
|
| 341 |
+
"bits": 16,
|
| 342 |
+
"data_type": "float"
|
| 343 |
+
},
|
| 344 |
+
"vision_tower.vision_model.encoder.layers.12.mlp.fc1": {
|
| 345 |
+
"bits": 16,
|
| 346 |
+
"data_type": "float"
|
| 347 |
+
},
|
| 348 |
+
"vision_tower.vision_model.encoder.layers.12.mlp.fc2": {
|
| 349 |
+
"bits": 16,
|
| 350 |
+
"data_type": "float"
|
| 351 |
+
},
|
| 352 |
+
"vision_tower.vision_model.encoder.layers.12.self_attn.k_proj": {
|
| 353 |
+
"bits": 16,
|
| 354 |
+
"data_type": "float"
|
| 355 |
+
},
|
| 356 |
+
"vision_tower.vision_model.encoder.layers.12.self_attn.out_proj": {
|
| 357 |
+
"bits": 16,
|
| 358 |
+
"data_type": "float"
|
| 359 |
+
},
|
| 360 |
+
"vision_tower.vision_model.encoder.layers.12.self_attn.q_proj": {
|
| 361 |
+
"bits": 16,
|
| 362 |
+
"data_type": "float"
|
| 363 |
+
},
|
| 364 |
+
"vision_tower.vision_model.encoder.layers.12.self_attn.v_proj": {
|
| 365 |
+
"bits": 16,
|
| 366 |
+
"data_type": "float"
|
| 367 |
+
},
|
| 368 |
+
"vision_tower.vision_model.encoder.layers.13.mlp.fc1": {
|
| 369 |
+
"bits": 16,
|
| 370 |
+
"data_type": "float"
|
| 371 |
+
},
|
| 372 |
+
"vision_tower.vision_model.encoder.layers.13.mlp.fc2": {
|
| 373 |
+
"bits": 16,
|
| 374 |
+
"data_type": "float"
|
| 375 |
+
},
|
| 376 |
+
"vision_tower.vision_model.encoder.layers.13.self_attn.k_proj": {
|
| 377 |
+
"bits": 16,
|
| 378 |
+
"data_type": "float"
|
| 379 |
+
},
|
| 380 |
+
"vision_tower.vision_model.encoder.layers.13.self_attn.out_proj": {
|
| 381 |
+
"bits": 16,
|
| 382 |
+
"data_type": "float"
|
| 383 |
+
},
|
| 384 |
+
"vision_tower.vision_model.encoder.layers.13.self_attn.q_proj": {
|
| 385 |
+
"bits": 16,
|
| 386 |
+
"data_type": "float"
|
| 387 |
+
},
|
| 388 |
+
"vision_tower.vision_model.encoder.layers.13.self_attn.v_proj": {
|
| 389 |
+
"bits": 16,
|
| 390 |
+
"data_type": "float"
|
| 391 |
+
},
|
| 392 |
+
"vision_tower.vision_model.encoder.layers.14.mlp.fc1": {
|
| 393 |
+
"bits": 16,
|
| 394 |
+
"data_type": "float"
|
| 395 |
+
},
|
| 396 |
+
"vision_tower.vision_model.encoder.layers.14.mlp.fc2": {
|
| 397 |
+
"bits": 16,
|
| 398 |
+
"data_type": "float"
|
| 399 |
+
},
|
| 400 |
+
"vision_tower.vision_model.encoder.layers.14.self_attn.k_proj": {
|
| 401 |
+
"bits": 16,
|
| 402 |
+
"data_type": "float"
|
| 403 |
+
},
|
| 404 |
+
"vision_tower.vision_model.encoder.layers.14.self_attn.out_proj": {
|
| 405 |
+
"bits": 16,
|
| 406 |
+
"data_type": "float"
|
| 407 |
+
},
|
| 408 |
+
"vision_tower.vision_model.encoder.layers.14.self_attn.q_proj": {
|
| 409 |
+
"bits": 16,
|
| 410 |
+
"data_type": "float"
|
| 411 |
+
},
|
| 412 |
+
"vision_tower.vision_model.encoder.layers.14.self_attn.v_proj": {
|
| 413 |
+
"bits": 16,
|
| 414 |
+
"data_type": "float"
|
| 415 |
+
},
|
| 416 |
+
"vision_tower.vision_model.encoder.layers.15.mlp.fc1": {
|
| 417 |
+
"bits": 16,
|
| 418 |
+
"data_type": "float"
|
| 419 |
+
},
|
| 420 |
+
"vision_tower.vision_model.encoder.layers.15.mlp.fc2": {
|
| 421 |
+
"bits": 16,
|
| 422 |
+
"data_type": "float"
|
| 423 |
+
},
|
| 424 |
+
"vision_tower.vision_model.encoder.layers.15.self_attn.k_proj": {
|
| 425 |
+
"bits": 16,
|
| 426 |
+
"data_type": "float"
|
| 427 |
+
},
|
| 428 |
+
"vision_tower.vision_model.encoder.layers.15.self_attn.out_proj": {
|
| 429 |
+
"bits": 16,
|
| 430 |
+
"data_type": "float"
|
| 431 |
+
},
|
| 432 |
+
"vision_tower.vision_model.encoder.layers.15.self_attn.q_proj": {
|
| 433 |
+
"bits": 16,
|
| 434 |
+
"data_type": "float"
|
| 435 |
+
},
|
| 436 |
+
"vision_tower.vision_model.encoder.layers.15.self_attn.v_proj": {
|
| 437 |
+
"bits": 16,
|
| 438 |
+
"data_type": "float"
|
| 439 |
+
},
|
| 440 |
+
"vision_tower.vision_model.encoder.layers.16.mlp.fc1": {
|
| 441 |
+
"bits": 16,
|
| 442 |
+
"data_type": "float"
|
| 443 |
+
},
|
| 444 |
+
"vision_tower.vision_model.encoder.layers.16.mlp.fc2": {
|
| 445 |
+
"bits": 16,
|
| 446 |
+
"data_type": "float"
|
| 447 |
+
},
|
| 448 |
+
"vision_tower.vision_model.encoder.layers.16.self_attn.k_proj": {
|
| 449 |
+
"bits": 16,
|
| 450 |
+
"data_type": "float"
|
| 451 |
+
},
|
| 452 |
+
"vision_tower.vision_model.encoder.layers.16.self_attn.out_proj": {
|
| 453 |
+
"bits": 16,
|
| 454 |
+
"data_type": "float"
|
| 455 |
+
},
|
| 456 |
+
"vision_tower.vision_model.encoder.layers.16.self_attn.q_proj": {
|
| 457 |
+
"bits": 16,
|
| 458 |
+
"data_type": "float"
|
| 459 |
+
},
|
| 460 |
+
"vision_tower.vision_model.encoder.layers.16.self_attn.v_proj": {
|
| 461 |
+
"bits": 16,
|
| 462 |
+
"data_type": "float"
|
| 463 |
+
},
|
| 464 |
+
"vision_tower.vision_model.encoder.layers.17.mlp.fc1": {
|
| 465 |
+
"bits": 16,
|
| 466 |
+
"data_type": "float"
|
| 467 |
+
},
|
| 468 |
+
"vision_tower.vision_model.encoder.layers.17.mlp.fc2": {
|
| 469 |
+
"bits": 16,
|
| 470 |
+
"data_type": "float"
|
| 471 |
+
},
|
| 472 |
+
"vision_tower.vision_model.encoder.layers.17.self_attn.k_proj": {
|
| 473 |
+
"bits": 16,
|
| 474 |
+
"data_type": "float"
|
| 475 |
+
},
|
| 476 |
+
"vision_tower.vision_model.encoder.layers.17.self_attn.out_proj": {
|
| 477 |
+
"bits": 16,
|
| 478 |
+
"data_type": "float"
|
| 479 |
+
},
|
| 480 |
+
"vision_tower.vision_model.encoder.layers.17.self_attn.q_proj": {
|
| 481 |
+
"bits": 16,
|
| 482 |
+
"data_type": "float"
|
| 483 |
+
},
|
| 484 |
+
"vision_tower.vision_model.encoder.layers.17.self_attn.v_proj": {
|
| 485 |
+
"bits": 16,
|
| 486 |
+
"data_type": "float"
|
| 487 |
+
},
|
| 488 |
+
"vision_tower.vision_model.encoder.layers.18.mlp.fc1": {
|
| 489 |
+
"bits": 16,
|
| 490 |
+
"data_type": "float"
|
| 491 |
+
},
|
| 492 |
+
"vision_tower.vision_model.encoder.layers.18.mlp.fc2": {
|
| 493 |
+
"bits": 16,
|
| 494 |
+
"data_type": "float"
|
| 495 |
+
},
|
| 496 |
+
"vision_tower.vision_model.encoder.layers.18.self_attn.k_proj": {
|
| 497 |
+
"bits": 16,
|
| 498 |
+
"data_type": "float"
|
| 499 |
+
},
|
| 500 |
+
"vision_tower.vision_model.encoder.layers.18.self_attn.out_proj": {
|
| 501 |
+
"bits": 16,
|
| 502 |
+
"data_type": "float"
|
| 503 |
+
},
|
| 504 |
+
"vision_tower.vision_model.encoder.layers.18.self_attn.q_proj": {
|
| 505 |
+
"bits": 16,
|
| 506 |
+
"data_type": "float"
|
| 507 |
+
},
|
| 508 |
+
"vision_tower.vision_model.encoder.layers.18.self_attn.v_proj": {
|
| 509 |
+
"bits": 16,
|
| 510 |
+
"data_type": "float"
|
| 511 |
+
},
|
| 512 |
+
"vision_tower.vision_model.encoder.layers.19.mlp.fc1": {
|
| 513 |
+
"bits": 16,
|
| 514 |
+
"data_type": "float"
|
| 515 |
+
},
|
| 516 |
+
"vision_tower.vision_model.encoder.layers.19.mlp.fc2": {
|
| 517 |
+
"bits": 16,
|
| 518 |
+
"data_type": "float"
|
| 519 |
+
},
|
| 520 |
+
"vision_tower.vision_model.encoder.layers.19.self_attn.k_proj": {
|
| 521 |
+
"bits": 16,
|
| 522 |
+
"data_type": "float"
|
| 523 |
+
},
|
| 524 |
+
"vision_tower.vision_model.encoder.layers.19.self_attn.out_proj": {
|
| 525 |
+
"bits": 16,
|
| 526 |
+
"data_type": "float"
|
| 527 |
+
},
|
| 528 |
+
"vision_tower.vision_model.encoder.layers.19.self_attn.q_proj": {
|
| 529 |
+
"bits": 16,
|
| 530 |
+
"data_type": "float"
|
| 531 |
+
},
|
| 532 |
+
"vision_tower.vision_model.encoder.layers.19.self_attn.v_proj": {
|
| 533 |
+
"bits": 16,
|
| 534 |
+
"data_type": "float"
|
| 535 |
+
},
|
| 536 |
+
"vision_tower.vision_model.encoder.layers.2.mlp.fc1": {
|
| 537 |
+
"bits": 16,
|
| 538 |
+
"data_type": "float"
|
| 539 |
+
},
|
| 540 |
+
"vision_tower.vision_model.encoder.layers.2.mlp.fc2": {
|
| 541 |
+
"bits": 16,
|
| 542 |
+
"data_type": "float"
|
| 543 |
+
},
|
| 544 |
+
"vision_tower.vision_model.encoder.layers.2.self_attn.k_proj": {
|
| 545 |
+
"bits": 16,
|
| 546 |
+
"data_type": "float"
|
| 547 |
+
},
|
| 548 |
+
"vision_tower.vision_model.encoder.layers.2.self_attn.out_proj": {
|
| 549 |
+
"bits": 16,
|
| 550 |
+
"data_type": "float"
|
| 551 |
+
},
|
| 552 |
+
"vision_tower.vision_model.encoder.layers.2.self_attn.q_proj": {
|
| 553 |
+
"bits": 16,
|
| 554 |
+
"data_type": "float"
|
| 555 |
+
},
|
| 556 |
+
"vision_tower.vision_model.encoder.layers.2.self_attn.v_proj": {
|
| 557 |
+
"bits": 16,
|
| 558 |
+
"data_type": "float"
|
| 559 |
+
},
|
| 560 |
+
"vision_tower.vision_model.encoder.layers.20.mlp.fc1": {
|
| 561 |
+
"bits": 16,
|
| 562 |
+
"data_type": "float"
|
| 563 |
+
},
|
| 564 |
+
"vision_tower.vision_model.encoder.layers.20.mlp.fc2": {
|
| 565 |
+
"bits": 16,
|
| 566 |
+
"data_type": "float"
|
| 567 |
+
},
|
| 568 |
+
"vision_tower.vision_model.encoder.layers.20.self_attn.k_proj": {
|
| 569 |
+
"bits": 16,
|
| 570 |
+
"data_type": "float"
|
| 571 |
+
},
|
| 572 |
+
"vision_tower.vision_model.encoder.layers.20.self_attn.out_proj": {
|
| 573 |
+
"bits": 16,
|
| 574 |
+
"data_type": "float"
|
| 575 |
+
},
|
| 576 |
+
"vision_tower.vision_model.encoder.layers.20.self_attn.q_proj": {
|
| 577 |
+
"bits": 16,
|
| 578 |
+
"data_type": "float"
|
| 579 |
+
},
|
| 580 |
+
"vision_tower.vision_model.encoder.layers.20.self_attn.v_proj": {
|
| 581 |
+
"bits": 16,
|
| 582 |
+
"data_type": "float"
|
| 583 |
+
},
|
| 584 |
+
"vision_tower.vision_model.encoder.layers.21.mlp.fc1": {
|
| 585 |
+
"bits": 16,
|
| 586 |
+
"data_type": "float"
|
| 587 |
+
},
|
| 588 |
+
"vision_tower.vision_model.encoder.layers.21.mlp.fc2": {
|
| 589 |
+
"bits": 16,
|
| 590 |
+
"data_type": "float"
|
| 591 |
+
},
|
| 592 |
+
"vision_tower.vision_model.encoder.layers.21.self_attn.k_proj": {
|
| 593 |
+
"bits": 16,
|
| 594 |
+
"data_type": "float"
|
| 595 |
+
},
|
| 596 |
+
"vision_tower.vision_model.encoder.layers.21.self_attn.out_proj": {
|
| 597 |
+
"bits": 16,
|
| 598 |
+
"data_type": "float"
|
| 599 |
+
},
|
| 600 |
+
"vision_tower.vision_model.encoder.layers.21.self_attn.q_proj": {
|
| 601 |
+
"bits": 16,
|
| 602 |
+
"data_type": "float"
|
| 603 |
+
},
|
| 604 |
+
"vision_tower.vision_model.encoder.layers.21.self_attn.v_proj": {
|
| 605 |
+
"bits": 16,
|
| 606 |
+
"data_type": "float"
|
| 607 |
+
},
|
| 608 |
+
"vision_tower.vision_model.encoder.layers.22.mlp.fc1": {
|
| 609 |
+
"bits": 16,
|
| 610 |
+
"data_type": "float"
|
| 611 |
+
},
|
| 612 |
+
"vision_tower.vision_model.encoder.layers.22.mlp.fc2": {
|
| 613 |
+
"bits": 16,
|
| 614 |
+
"data_type": "float"
|
| 615 |
+
},
|
| 616 |
+
"vision_tower.vision_model.encoder.layers.22.self_attn.k_proj": {
|
| 617 |
+
"bits": 16,
|
| 618 |
+
"data_type": "float"
|
| 619 |
+
},
|
| 620 |
+
"vision_tower.vision_model.encoder.layers.22.self_attn.out_proj": {
|
| 621 |
+
"bits": 16,
|
| 622 |
+
"data_type": "float"
|
| 623 |
+
},
|
| 624 |
+
"vision_tower.vision_model.encoder.layers.22.self_attn.q_proj": {
|
| 625 |
+
"bits": 16,
|
| 626 |
+
"data_type": "float"
|
| 627 |
+
},
|
| 628 |
+
"vision_tower.vision_model.encoder.layers.22.self_attn.v_proj": {
|
| 629 |
+
"bits": 16,
|
| 630 |
+
"data_type": "float"
|
| 631 |
+
},
|
| 632 |
+
"vision_tower.vision_model.encoder.layers.23.mlp.fc1": {
|
| 633 |
+
"bits": 16,
|
| 634 |
+
"data_type": "float"
|
| 635 |
+
},
|
| 636 |
+
"vision_tower.vision_model.encoder.layers.23.mlp.fc2": {
|
| 637 |
+
"bits": 16,
|
| 638 |
+
"data_type": "float"
|
| 639 |
+
},
|
| 640 |
+
"vision_tower.vision_model.encoder.layers.23.self_attn.k_proj": {
|
| 641 |
+
"bits": 16,
|
| 642 |
+
"data_type": "float"
|
| 643 |
+
},
|
| 644 |
+
"vision_tower.vision_model.encoder.layers.23.self_attn.out_proj": {
|
| 645 |
+
"bits": 16,
|
| 646 |
+
"data_type": "float"
|
| 647 |
+
},
|
| 648 |
+
"vision_tower.vision_model.encoder.layers.23.self_attn.q_proj": {
|
| 649 |
+
"bits": 16,
|
| 650 |
+
"data_type": "float"
|
| 651 |
+
},
|
| 652 |
+
"vision_tower.vision_model.encoder.layers.23.self_attn.v_proj": {
|
| 653 |
+
"bits": 16,
|
| 654 |
+
"data_type": "float"
|
| 655 |
+
},
|
| 656 |
+
"vision_tower.vision_model.encoder.layers.24.mlp.fc1": {
|
| 657 |
+
"bits": 16,
|
| 658 |
+
"data_type": "float"
|
| 659 |
+
},
|
| 660 |
+
"vision_tower.vision_model.encoder.layers.24.mlp.fc2": {
|
| 661 |
+
"bits": 16,
|
| 662 |
+
"data_type": "float"
|
| 663 |
+
},
|
| 664 |
+
"vision_tower.vision_model.encoder.layers.24.self_attn.k_proj": {
|
| 665 |
+
"bits": 16,
|
| 666 |
+
"data_type": "float"
|
| 667 |
+
},
|
| 668 |
+
"vision_tower.vision_model.encoder.layers.24.self_attn.out_proj": {
|
| 669 |
+
"bits": 16,
|
| 670 |
+
"data_type": "float"
|
| 671 |
+
},
|
| 672 |
+
"vision_tower.vision_model.encoder.layers.24.self_attn.q_proj": {
|
| 673 |
+
"bits": 16,
|
| 674 |
+
"data_type": "float"
|
| 675 |
+
},
|
| 676 |
+
"vision_tower.vision_model.encoder.layers.24.self_attn.v_proj": {
|
| 677 |
+
"bits": 16,
|
| 678 |
+
"data_type": "float"
|
| 679 |
+
},
|
| 680 |
+
"vision_tower.vision_model.encoder.layers.25.mlp.fc1": {
|
| 681 |
+
"bits": 16,
|
| 682 |
+
"data_type": "float"
|
| 683 |
+
},
|
| 684 |
+
"vision_tower.vision_model.encoder.layers.25.mlp.fc2": {
|
| 685 |
+
"bits": 16,
|
| 686 |
+
"data_type": "float"
|
| 687 |
+
},
|
| 688 |
+
"vision_tower.vision_model.encoder.layers.25.self_attn.k_proj": {
|
| 689 |
+
"bits": 16,
|
| 690 |
+
"data_type": "float"
|
| 691 |
+
},
|
| 692 |
+
"vision_tower.vision_model.encoder.layers.25.self_attn.out_proj": {
|
| 693 |
+
"bits": 16,
|
| 694 |
+
"data_type": "float"
|
| 695 |
+
},
|
| 696 |
+
"vision_tower.vision_model.encoder.layers.25.self_attn.q_proj": {
|
| 697 |
+
"bits": 16,
|
| 698 |
+
"data_type": "float"
|
| 699 |
+
},
|
| 700 |
+
"vision_tower.vision_model.encoder.layers.25.self_attn.v_proj": {
|
| 701 |
+
"bits": 16,
|
| 702 |
+
"data_type": "float"
|
| 703 |
+
},
|
| 704 |
+
"vision_tower.vision_model.encoder.layers.26.mlp.fc1": {
|
| 705 |
+
"bits": 16,
|
| 706 |
+
"data_type": "float"
|
| 707 |
+
},
|
| 708 |
+
"vision_tower.vision_model.encoder.layers.26.mlp.fc2": {
|
| 709 |
+
"bits": 16,
|
| 710 |
+
"data_type": "float"
|
| 711 |
+
},
|
| 712 |
+
"vision_tower.vision_model.encoder.layers.26.self_attn.k_proj": {
|
| 713 |
+
"bits": 16,
|
| 714 |
+
"data_type": "float"
|
| 715 |
+
},
|
| 716 |
+
"vision_tower.vision_model.encoder.layers.26.self_attn.out_proj": {
|
| 717 |
+
"bits": 16,
|
| 718 |
+
"data_type": "float"
|
| 719 |
+
},
|
| 720 |
+
"vision_tower.vision_model.encoder.layers.26.self_attn.q_proj": {
|
| 721 |
+
"bits": 16,
|
| 722 |
+
"data_type": "float"
|
| 723 |
+
},
|
| 724 |
+
"vision_tower.vision_model.encoder.layers.26.self_attn.v_proj": {
|
| 725 |
+
"bits": 16,
|
| 726 |
+
"data_type": "float"
|
| 727 |
+
},
|
| 728 |
+
"vision_tower.vision_model.encoder.layers.27.mlp.fc1": {
|
| 729 |
+
"bits": 16,
|
| 730 |
+
"data_type": "float"
|
| 731 |
+
},
|
| 732 |
+
"vision_tower.vision_model.encoder.layers.27.mlp.fc2": {
|
| 733 |
+
"bits": 16,
|
| 734 |
+
"data_type": "float"
|
| 735 |
+
},
|
| 736 |
+
"vision_tower.vision_model.encoder.layers.27.self_attn.k_proj": {
|
| 737 |
+
"bits": 16,
|
| 738 |
+
"data_type": "float"
|
| 739 |
+
},
|
| 740 |
+
"vision_tower.vision_model.encoder.layers.27.self_attn.out_proj": {
|
| 741 |
+
"bits": 16,
|
| 742 |
+
"data_type": "float"
|
| 743 |
+
},
|
| 744 |
+
"vision_tower.vision_model.encoder.layers.27.self_attn.q_proj": {
|
| 745 |
+
"bits": 16,
|
| 746 |
+
"data_type": "float"
|
| 747 |
+
},
|
| 748 |
+
"vision_tower.vision_model.encoder.layers.27.self_attn.v_proj": {
|
| 749 |
+
"bits": 16,
|
| 750 |
+
"data_type": "float"
|
| 751 |
+
},
|
| 752 |
+
"vision_tower.vision_model.encoder.layers.28.mlp.fc1": {
|
| 753 |
+
"bits": 16,
|
| 754 |
+
"data_type": "float"
|
| 755 |
+
},
|
| 756 |
+
"vision_tower.vision_model.encoder.layers.28.mlp.fc2": {
|
| 757 |
+
"bits": 16,
|
| 758 |
+
"data_type": "float"
|
| 759 |
+
},
|
| 760 |
+
"vision_tower.vision_model.encoder.layers.28.self_attn.k_proj": {
|
| 761 |
+
"bits": 16,
|
| 762 |
+
"data_type": "float"
|
| 763 |
+
},
|
| 764 |
+
"vision_tower.vision_model.encoder.layers.28.self_attn.out_proj": {
|
| 765 |
+
"bits": 16,
|
| 766 |
+
"data_type": "float"
|
| 767 |
+
},
|
| 768 |
+
"vision_tower.vision_model.encoder.layers.28.self_attn.q_proj": {
|
| 769 |
+
"bits": 16,
|
| 770 |
+
"data_type": "float"
|
| 771 |
+
},
|
| 772 |
+
"vision_tower.vision_model.encoder.layers.28.self_attn.v_proj": {
|
| 773 |
+
"bits": 16,
|
| 774 |
+
"data_type": "float"
|
| 775 |
+
},
|
| 776 |
+
"vision_tower.vision_model.encoder.layers.29.mlp.fc1": {
|
| 777 |
+
"bits": 16,
|
| 778 |
+
"data_type": "float"
|
| 779 |
+
},
|
| 780 |
+
"vision_tower.vision_model.encoder.layers.29.mlp.fc2": {
|
| 781 |
+
"bits": 16,
|
| 782 |
+
"data_type": "float"
|
| 783 |
+
},
|
| 784 |
+
"vision_tower.vision_model.encoder.layers.29.self_attn.k_proj": {
|
| 785 |
+
"bits": 16,
|
| 786 |
+
"data_type": "float"
|
| 787 |
+
},
|
| 788 |
+
"vision_tower.vision_model.encoder.layers.29.self_attn.out_proj": {
|
| 789 |
+
"bits": 16,
|
| 790 |
+
"data_type": "float"
|
| 791 |
+
},
|
| 792 |
+
"vision_tower.vision_model.encoder.layers.29.self_attn.q_proj": {
|
| 793 |
+
"bits": 16,
|
| 794 |
+
"data_type": "float"
|
| 795 |
+
},
|
| 796 |
+
"vision_tower.vision_model.encoder.layers.29.self_attn.v_proj": {
|
| 797 |
+
"bits": 16,
|
| 798 |
+
"data_type": "float"
|
| 799 |
+
},
|
| 800 |
+
"vision_tower.vision_model.encoder.layers.3.mlp.fc1": {
|
| 801 |
+
"bits": 16,
|
| 802 |
+
"data_type": "float"
|
| 803 |
+
},
|
| 804 |
+
"vision_tower.vision_model.encoder.layers.3.mlp.fc2": {
|
| 805 |
+
"bits": 16,
|
| 806 |
+
"data_type": "float"
|
| 807 |
+
},
|
| 808 |
+
"vision_tower.vision_model.encoder.layers.3.self_attn.k_proj": {
|
| 809 |
+
"bits": 16,
|
| 810 |
+
"data_type": "float"
|
| 811 |
+
},
|
| 812 |
+
"vision_tower.vision_model.encoder.layers.3.self_attn.out_proj": {
|
| 813 |
+
"bits": 16,
|
| 814 |
+
"data_type": "float"
|
| 815 |
+
},
|
| 816 |
+
"vision_tower.vision_model.encoder.layers.3.self_attn.q_proj": {
|
| 817 |
+
"bits": 16,
|
| 818 |
+
"data_type": "float"
|
| 819 |
+
},
|
| 820 |
+
"vision_tower.vision_model.encoder.layers.3.self_attn.v_proj": {
|
| 821 |
+
"bits": 16,
|
| 822 |
+
"data_type": "float"
|
| 823 |
+
},
|
| 824 |
+
"vision_tower.vision_model.encoder.layers.30.mlp.fc1": {
|
| 825 |
+
"bits": 16,
|
| 826 |
+
"data_type": "float"
|
| 827 |
+
},
|
| 828 |
+
"vision_tower.vision_model.encoder.layers.30.mlp.fc2": {
|
| 829 |
+
"bits": 16,
|
| 830 |
+
"data_type": "float"
|
| 831 |
+
},
|
| 832 |
+
"vision_tower.vision_model.encoder.layers.30.self_attn.k_proj": {
|
| 833 |
+
"bits": 16,
|
| 834 |
+
"data_type": "float"
|
| 835 |
+
},
|
| 836 |
+
"vision_tower.vision_model.encoder.layers.30.self_attn.out_proj": {
|
| 837 |
+
"bits": 16,
|
| 838 |
+
"data_type": "float"
|
| 839 |
+
},
|
| 840 |
+
"vision_tower.vision_model.encoder.layers.30.self_attn.q_proj": {
|
| 841 |
+
"bits": 16,
|
| 842 |
+
"data_type": "float"
|
| 843 |
+
},
|
| 844 |
+
"vision_tower.vision_model.encoder.layers.30.self_attn.v_proj": {
|
| 845 |
+
"bits": 16,
|
| 846 |
+
"data_type": "float"
|
| 847 |
+
},
|
| 848 |
+
"vision_tower.vision_model.encoder.layers.31.mlp.fc1": {
|
| 849 |
+
"bits": 16,
|
| 850 |
+
"data_type": "float"
|
| 851 |
+
},
|
| 852 |
+
"vision_tower.vision_model.encoder.layers.31.mlp.fc2": {
|
| 853 |
+
"bits": 16,
|
| 854 |
+
"data_type": "float"
|
| 855 |
+
},
|
| 856 |
+
"vision_tower.vision_model.encoder.layers.31.self_attn.k_proj": {
|
| 857 |
+
"bits": 16,
|
| 858 |
+
"data_type": "float"
|
| 859 |
+
},
|
| 860 |
+
"vision_tower.vision_model.encoder.layers.31.self_attn.out_proj": {
|
| 861 |
+
"bits": 16,
|
| 862 |
+
"data_type": "float"
|
| 863 |
+
},
|
| 864 |
+
"vision_tower.vision_model.encoder.layers.31.self_attn.q_proj": {
|
| 865 |
+
"bits": 16,
|
| 866 |
+
"data_type": "float"
|
| 867 |
+
},
|
| 868 |
+
"vision_tower.vision_model.encoder.layers.31.self_attn.v_proj": {
|
| 869 |
+
"bits": 16,
|
| 870 |
+
"data_type": "float"
|
| 871 |
+
},
|
| 872 |
+
"vision_tower.vision_model.encoder.layers.4.mlp.fc1": {
|
| 873 |
+
"bits": 16,
|
| 874 |
+
"data_type": "float"
|
| 875 |
+
},
|
| 876 |
+
"vision_tower.vision_model.encoder.layers.4.mlp.fc2": {
|
| 877 |
+
"bits": 16,
|
| 878 |
+
"data_type": "float"
|
| 879 |
+
},
|
| 880 |
+
"vision_tower.vision_model.encoder.layers.4.self_attn.k_proj": {
|
| 881 |
+
"bits": 16,
|
| 882 |
+
"data_type": "float"
|
| 883 |
+
},
|
| 884 |
+
"vision_tower.vision_model.encoder.layers.4.self_attn.out_proj": {
|
| 885 |
+
"bits": 16,
|
| 886 |
+
"data_type": "float"
|
| 887 |
+
},
|
| 888 |
+
"vision_tower.vision_model.encoder.layers.4.self_attn.q_proj": {
|
| 889 |
+
"bits": 16,
|
| 890 |
+
"data_type": "float"
|
| 891 |
+
},
|
| 892 |
+
"vision_tower.vision_model.encoder.layers.4.self_attn.v_proj": {
|
| 893 |
+
"bits": 16,
|
| 894 |
+
"data_type": "float"
|
| 895 |
+
},
|
| 896 |
+
"vision_tower.vision_model.encoder.layers.5.mlp.fc1": {
|
| 897 |
+
"bits": 16,
|
| 898 |
+
"data_type": "float"
|
| 899 |
+
},
|
| 900 |
+
"vision_tower.vision_model.encoder.layers.5.mlp.fc2": {
|
| 901 |
+
"bits": 16,
|
| 902 |
+
"data_type": "float"
|
| 903 |
+
},
|
| 904 |
+
"vision_tower.vision_model.encoder.layers.5.self_attn.k_proj": {
|
| 905 |
+
"bits": 16,
|
| 906 |
+
"data_type": "float"
|
| 907 |
+
},
|
| 908 |
+
"vision_tower.vision_model.encoder.layers.5.self_attn.out_proj": {
|
| 909 |
+
"bits": 16,
|
| 910 |
+
"data_type": "float"
|
| 911 |
+
},
|
| 912 |
+
"vision_tower.vision_model.encoder.layers.5.self_attn.q_proj": {
|
| 913 |
+
"bits": 16,
|
| 914 |
+
"data_type": "float"
|
| 915 |
+
},
|
| 916 |
+
"vision_tower.vision_model.encoder.layers.5.self_attn.v_proj": {
|
| 917 |
+
"bits": 16,
|
| 918 |
+
"data_type": "float"
|
| 919 |
+
},
|
| 920 |
+
"vision_tower.vision_model.encoder.layers.6.mlp.fc1": {
|
| 921 |
+
"bits": 16,
|
| 922 |
+
"data_type": "float"
|
| 923 |
+
},
|
| 924 |
+
"vision_tower.vision_model.encoder.layers.6.mlp.fc2": {
|
| 925 |
+
"bits": 16,
|
| 926 |
+
"data_type": "float"
|
| 927 |
+
},
|
| 928 |
+
"vision_tower.vision_model.encoder.layers.6.self_attn.k_proj": {
|
| 929 |
+
"bits": 16,
|
| 930 |
+
"data_type": "float"
|
| 931 |
+
},
|
| 932 |
+
"vision_tower.vision_model.encoder.layers.6.self_attn.out_proj": {
|
| 933 |
+
"bits": 16,
|
| 934 |
+
"data_type": "float"
|
| 935 |
+
},
|
| 936 |
+
"vision_tower.vision_model.encoder.layers.6.self_attn.q_proj": {
|
| 937 |
+
"bits": 16,
|
| 938 |
+
"data_type": "float"
|
| 939 |
+
},
|
| 940 |
+
"vision_tower.vision_model.encoder.layers.6.self_attn.v_proj": {
|
| 941 |
+
"bits": 16,
|
| 942 |
+
"data_type": "float"
|
| 943 |
+
},
|
| 944 |
+
"vision_tower.vision_model.encoder.layers.7.mlp.fc1": {
|
| 945 |
+
"bits": 16,
|
| 946 |
+
"data_type": "float"
|
| 947 |
+
},
|
| 948 |
+
"vision_tower.vision_model.encoder.layers.7.mlp.fc2": {
|
| 949 |
+
"bits": 16,
|
| 950 |
+
"data_type": "float"
|
| 951 |
+
},
|
| 952 |
+
"vision_tower.vision_model.encoder.layers.7.self_attn.k_proj": {
|
| 953 |
+
"bits": 16,
|
| 954 |
+
"data_type": "float"
|
| 955 |
+
},
|
| 956 |
+
"vision_tower.vision_model.encoder.layers.7.self_attn.out_proj": {
|
| 957 |
+
"bits": 16,
|
| 958 |
+
"data_type": "float"
|
| 959 |
+
},
|
| 960 |
+
"vision_tower.vision_model.encoder.layers.7.self_attn.q_proj": {
|
| 961 |
+
"bits": 16,
|
| 962 |
+
"data_type": "float"
|
| 963 |
+
},
|
| 964 |
+
"vision_tower.vision_model.encoder.layers.7.self_attn.v_proj": {
|
| 965 |
+
"bits": 16,
|
| 966 |
+
"data_type": "float"
|
| 967 |
+
},
|
| 968 |
+
"vision_tower.vision_model.encoder.layers.8.mlp.fc1": {
|
| 969 |
+
"bits": 16,
|
| 970 |
+
"data_type": "float"
|
| 971 |
+
},
|
| 972 |
+
"vision_tower.vision_model.encoder.layers.8.mlp.fc2": {
|
| 973 |
+
"bits": 16,
|
| 974 |
+
"data_type": "float"
|
| 975 |
+
},
|
| 976 |
+
"vision_tower.vision_model.encoder.layers.8.self_attn.k_proj": {
|
| 977 |
+
"bits": 16,
|
| 978 |
+
"data_type": "float"
|
| 979 |
+
},
|
| 980 |
+
"vision_tower.vision_model.encoder.layers.8.self_attn.out_proj": {
|
| 981 |
+
"bits": 16,
|
| 982 |
+
"data_type": "float"
|
| 983 |
+
},
|
| 984 |
+
"vision_tower.vision_model.encoder.layers.8.self_attn.q_proj": {
|
| 985 |
+
"bits": 16,
|
| 986 |
+
"data_type": "float"
|
| 987 |
+
},
|
| 988 |
+
"vision_tower.vision_model.encoder.layers.8.self_attn.v_proj": {
|
| 989 |
+
"bits": 16,
|
| 990 |
+
"data_type": "float"
|
| 991 |
+
},
|
| 992 |
+
"vision_tower.vision_model.encoder.layers.9.mlp.fc1": {
|
| 993 |
+
"bits": 16,
|
| 994 |
+
"data_type": "float"
|
| 995 |
+
},
|
| 996 |
+
"vision_tower.vision_model.encoder.layers.9.mlp.fc2": {
|
| 997 |
+
"bits": 16,
|
| 998 |
+
"data_type": "float"
|
| 999 |
+
},
|
| 1000 |
+
"vision_tower.vision_model.encoder.layers.9.self_attn.k_proj": {
|
| 1001 |
+
"bits": 16,
|
| 1002 |
+
"data_type": "float"
|
| 1003 |
+
},
|
| 1004 |
+
"vision_tower.vision_model.encoder.layers.9.self_attn.out_proj": {
|
| 1005 |
+
"bits": 16,
|
| 1006 |
+
"data_type": "float"
|
| 1007 |
+
},
|
| 1008 |
+
"vision_tower.vision_model.encoder.layers.9.self_attn.q_proj": {
|
| 1009 |
+
"bits": 16,
|
| 1010 |
+
"data_type": "float"
|
| 1011 |
+
},
|
| 1012 |
+
"vision_tower.vision_model.encoder.layers.9.self_attn.v_proj": {
|
| 1013 |
+
"bits": 16,
|
| 1014 |
+
"data_type": "float"
|
| 1015 |
+
},
|
| 1016 |
+
"multi_modal_projector.linear_1": {
|
| 1017 |
+
"bits": 16,
|
| 1018 |
+
"data_type": "float"
|
| 1019 |
+
},
|
| 1020 |
+
"multi_modal_projector.linear_2": {
|
| 1021 |
+
"bits": 16,
|
| 1022 |
+
"data_type": "float"
|
| 1023 |
+
},
|
| 1024 |
+
"patch_merge_mlp.linear_1": {
|
| 1025 |
+
"bits": 16,
|
| 1026 |
+
"data_type": "float"
|
| 1027 |
+
},
|
| 1028 |
+
"patch_merge_mlp.linear_2": {
|
| 1029 |
+
"bits": 16,
|
| 1030 |
+
"data_type": "float"
|
| 1031 |
+
}
|
| 1032 |
+
}
|
| 1033 |
+
}
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "]~b]",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": false,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"eos_token": {
|
| 10 |
+
"content": "[e~[",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": false,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
}
|
| 16 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,501 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"added_tokens_decoder": {
|
| 4 |
+
"200000": {
|
| 5 |
+
"content": "]!p~[",
|
| 6 |
+
"lstrip": false,
|
| 7 |
+
"normalized": false,
|
| 8 |
+
"rstrip": false,
|
| 9 |
+
"single_word": false,
|
| 10 |
+
"special": true
|
| 11 |
+
},
|
| 12 |
+
"200001": {
|
| 13 |
+
"content": "<fim_prefix>",
|
| 14 |
+
"lstrip": false,
|
| 15 |
+
"normalized": false,
|
| 16 |
+
"rstrip": false,
|
| 17 |
+
"single_word": false,
|
| 18 |
+
"special": true
|
| 19 |
+
},
|
| 20 |
+
"200002": {
|
| 21 |
+
"content": "<fim_middle>",
|
| 22 |
+
"lstrip": false,
|
| 23 |
+
"normalized": false,
|
| 24 |
+
"rstrip": false,
|
| 25 |
+
"single_word": false,
|
| 26 |
+
"special": true
|
| 27 |
+
},
|
| 28 |
+
"200003": {
|
| 29 |
+
"content": "<fim_suffix>",
|
| 30 |
+
"lstrip": false,
|
| 31 |
+
"normalized": false,
|
| 32 |
+
"rstrip": false,
|
| 33 |
+
"single_word": false,
|
| 34 |
+
"special": true
|
| 35 |
+
},
|
| 36 |
+
"200004": {
|
| 37 |
+
"content": "<fim_pad>",
|
| 38 |
+
"lstrip": false,
|
| 39 |
+
"normalized": false,
|
| 40 |
+
"rstrip": false,
|
| 41 |
+
"single_word": false,
|
| 42 |
+
"special": true
|
| 43 |
+
},
|
| 44 |
+
"200005": {
|
| 45 |
+
"content": "<reponame>",
|
| 46 |
+
"lstrip": false,
|
| 47 |
+
"normalized": false,
|
| 48 |
+
"rstrip": false,
|
| 49 |
+
"single_word": false,
|
| 50 |
+
"special": true
|
| 51 |
+
},
|
| 52 |
+
"200006": {
|
| 53 |
+
"content": "<filename>",
|
| 54 |
+
"lstrip": false,
|
| 55 |
+
"normalized": false,
|
| 56 |
+
"rstrip": false,
|
| 57 |
+
"single_word": false,
|
| 58 |
+
"special": true
|
| 59 |
+
},
|
| 60 |
+
"200007": {
|
| 61 |
+
"content": "<gh_stars>",
|
| 62 |
+
"lstrip": false,
|
| 63 |
+
"normalized": false,
|
| 64 |
+
"rstrip": false,
|
| 65 |
+
"single_word": false,
|
| 66 |
+
"special": true
|
| 67 |
+
},
|
| 68 |
+
"200008": {
|
| 69 |
+
"content": "<issue_start>",
|
| 70 |
+
"lstrip": false,
|
| 71 |
+
"normalized": false,
|
| 72 |
+
"rstrip": false,
|
| 73 |
+
"single_word": false,
|
| 74 |
+
"special": true
|
| 75 |
+
},
|
| 76 |
+
"200009": {
|
| 77 |
+
"content": "<issue_comment>",
|
| 78 |
+
"lstrip": false,
|
| 79 |
+
"normalized": false,
|
| 80 |
+
"rstrip": false,
|
| 81 |
+
"single_word": false,
|
| 82 |
+
"special": true
|
| 83 |
+
},
|
| 84 |
+
"200010": {
|
| 85 |
+
"content": "<issue_closed>",
|
| 86 |
+
"lstrip": false,
|
| 87 |
+
"normalized": false,
|
| 88 |
+
"rstrip": false,
|
| 89 |
+
"single_word": false,
|
| 90 |
+
"special": true
|
| 91 |
+
},
|
| 92 |
+
"200011": {
|
| 93 |
+
"content": "<jupyter_start>",
|
| 94 |
+
"lstrip": false,
|
| 95 |
+
"normalized": false,
|
| 96 |
+
"rstrip": false,
|
| 97 |
+
"single_word": false,
|
| 98 |
+
"special": true
|
| 99 |
+
},
|
| 100 |
+
"200012": {
|
| 101 |
+
"content": "<jupyter_text>",
|
| 102 |
+
"lstrip": false,
|
| 103 |
+
"normalized": false,
|
| 104 |
+
"rstrip": false,
|
| 105 |
+
"single_word": false,
|
| 106 |
+
"special": true
|
| 107 |
+
},
|
| 108 |
+
"200013": {
|
| 109 |
+
"content": "<jupyter_code>",
|
| 110 |
+
"lstrip": false,
|
| 111 |
+
"normalized": false,
|
| 112 |
+
"rstrip": false,
|
| 113 |
+
"single_word": false,
|
| 114 |
+
"special": true
|
| 115 |
+
},
|
| 116 |
+
"200014": {
|
| 117 |
+
"content": "<jupyter_output>",
|
| 118 |
+
"lstrip": false,
|
| 119 |
+
"normalized": false,
|
| 120 |
+
"rstrip": false,
|
| 121 |
+
"single_word": false,
|
| 122 |
+
"special": true
|
| 123 |
+
},
|
| 124 |
+
"200015": {
|
| 125 |
+
"content": "<empty_output>",
|
| 126 |
+
"lstrip": false,
|
| 127 |
+
"normalized": false,
|
| 128 |
+
"rstrip": false,
|
| 129 |
+
"single_word": false,
|
| 130 |
+
"special": true
|
| 131 |
+
},
|
| 132 |
+
"200016": {
|
| 133 |
+
"content": "<commit_before>",
|
| 134 |
+
"lstrip": false,
|
| 135 |
+
"normalized": false,
|
| 136 |
+
"rstrip": false,
|
| 137 |
+
"single_word": false,
|
| 138 |
+
"special": true
|
| 139 |
+
},
|
| 140 |
+
"200017": {
|
| 141 |
+
"content": "<commit_msg>",
|
| 142 |
+
"lstrip": false,
|
| 143 |
+
"normalized": false,
|
| 144 |
+
"rstrip": false,
|
| 145 |
+
"single_word": false,
|
| 146 |
+
"special": true
|
| 147 |
+
},
|
| 148 |
+
"200018": {
|
| 149 |
+
"content": "<commit_after>",
|
| 150 |
+
"lstrip": false,
|
| 151 |
+
"normalized": false,
|
| 152 |
+
"rstrip": false,
|
| 153 |
+
"single_word": false,
|
| 154 |
+
"special": true
|
| 155 |
+
},
|
| 156 |
+
"200019": {
|
| 157 |
+
"content": "]~b]",
|
| 158 |
+
"lstrip": false,
|
| 159 |
+
"normalized": false,
|
| 160 |
+
"rstrip": false,
|
| 161 |
+
"single_word": false,
|
| 162 |
+
"special": true
|
| 163 |
+
},
|
| 164 |
+
"200020": {
|
| 165 |
+
"content": "[e~[",
|
| 166 |
+
"lstrip": false,
|
| 167 |
+
"normalized": false,
|
| 168 |
+
"rstrip": false,
|
| 169 |
+
"single_word": false,
|
| 170 |
+
"special": true
|
| 171 |
+
},
|
| 172 |
+
"200021": {
|
| 173 |
+
"content": "]!d~[",
|
| 174 |
+
"lstrip": false,
|
| 175 |
+
"normalized": false,
|
| 176 |
+
"rstrip": false,
|
| 177 |
+
"single_word": false,
|
| 178 |
+
"special": true
|
| 179 |
+
},
|
| 180 |
+
"200022": {
|
| 181 |
+
"content": "<function_call>",
|
| 182 |
+
"lstrip": false,
|
| 183 |
+
"normalized": false,
|
| 184 |
+
"rstrip": false,
|
| 185 |
+
"single_word": false,
|
| 186 |
+
"special": true
|
| 187 |
+
},
|
| 188 |
+
"200023": {
|
| 189 |
+
"content": "<code_interpreter>",
|
| 190 |
+
"lstrip": false,
|
| 191 |
+
"normalized": false,
|
| 192 |
+
"rstrip": false,
|
| 193 |
+
"single_word": false,
|
| 194 |
+
"special": true
|
| 195 |
+
},
|
| 196 |
+
"200024": {
|
| 197 |
+
"content": "]<]speech[>[",
|
| 198 |
+
"lstrip": false,
|
| 199 |
+
"normalized": false,
|
| 200 |
+
"rstrip": false,
|
| 201 |
+
"single_word": false,
|
| 202 |
+
"special": true
|
| 203 |
+
},
|
| 204 |
+
"200025": {
|
| 205 |
+
"content": "]<]image[>[",
|
| 206 |
+
"lstrip": false,
|
| 207 |
+
"normalized": false,
|
| 208 |
+
"rstrip": false,
|
| 209 |
+
"single_word": false,
|
| 210 |
+
"special": true
|
| 211 |
+
},
|
| 212 |
+
"200026": {
|
| 213 |
+
"content": "]<]video[>[",
|
| 214 |
+
"lstrip": false,
|
| 215 |
+
"normalized": false,
|
| 216 |
+
"rstrip": false,
|
| 217 |
+
"single_word": false,
|
| 218 |
+
"special": true
|
| 219 |
+
},
|
| 220 |
+
"200027": {
|
| 221 |
+
"content": "]<]start of speech[>[",
|
| 222 |
+
"lstrip": false,
|
| 223 |
+
"normalized": false,
|
| 224 |
+
"rstrip": false,
|
| 225 |
+
"single_word": false,
|
| 226 |
+
"special": true
|
| 227 |
+
},
|
| 228 |
+
"200028": {
|
| 229 |
+
"content": "]<]end of speech[>[",
|
| 230 |
+
"lstrip": false,
|
| 231 |
+
"normalized": false,
|
| 232 |
+
"rstrip": false,
|
| 233 |
+
"single_word": false,
|
| 234 |
+
"special": true
|
| 235 |
+
},
|
| 236 |
+
"200029": {
|
| 237 |
+
"content": "]<]start of image[>[",
|
| 238 |
+
"lstrip": false,
|
| 239 |
+
"normalized": false,
|
| 240 |
+
"rstrip": false,
|
| 241 |
+
"single_word": false,
|
| 242 |
+
"special": true
|
| 243 |
+
},
|
| 244 |
+
"200030": {
|
| 245 |
+
"content": "]<]end of image[>[",
|
| 246 |
+
"lstrip": false,
|
| 247 |
+
"normalized": false,
|
| 248 |
+
"rstrip": false,
|
| 249 |
+
"single_word": false,
|
| 250 |
+
"special": true
|
| 251 |
+
},
|
| 252 |
+
"200031": {
|
| 253 |
+
"content": "]<]start of video[>[",
|
| 254 |
+
"lstrip": false,
|
| 255 |
+
"normalized": false,
|
| 256 |
+
"rstrip": false,
|
| 257 |
+
"single_word": false,
|
| 258 |
+
"special": true
|
| 259 |
+
},
|
| 260 |
+
"200032": {
|
| 261 |
+
"content": "]<]end of video[>[",
|
| 262 |
+
"lstrip": false,
|
| 263 |
+
"normalized": false,
|
| 264 |
+
"rstrip": false,
|
| 265 |
+
"single_word": false,
|
| 266 |
+
"special": true
|
| 267 |
+
},
|
| 268 |
+
"200033": {
|
| 269 |
+
"content": "]<]vision pad[>[",
|
| 270 |
+
"lstrip": false,
|
| 271 |
+
"normalized": false,
|
| 272 |
+
"rstrip": false,
|
| 273 |
+
"single_word": false,
|
| 274 |
+
"special": true
|
| 275 |
+
},
|
| 276 |
+
"200034": {
|
| 277 |
+
"content": "]~!b[",
|
| 278 |
+
"lstrip": false,
|
| 279 |
+
"normalized": false,
|
| 280 |
+
"rstrip": false,
|
| 281 |
+
"single_word": false,
|
| 282 |
+
"special": true
|
| 283 |
+
},
|
| 284 |
+
"200035": {
|
| 285 |
+
"content": "<jupyter_error>",
|
| 286 |
+
"lstrip": false,
|
| 287 |
+
"normalized": false,
|
| 288 |
+
"rstrip": false,
|
| 289 |
+
"single_word": false,
|
| 290 |
+
"special": true
|
| 291 |
+
},
|
| 292 |
+
"200036": {
|
| 293 |
+
"content": "<add_file>",
|
| 294 |
+
"lstrip": false,
|
| 295 |
+
"normalized": false,
|
| 296 |
+
"rstrip": false,
|
| 297 |
+
"single_word": false,
|
| 298 |
+
"special": true
|
| 299 |
+
},
|
| 300 |
+
"200037": {
|
| 301 |
+
"content": "<delete_file>",
|
| 302 |
+
"lstrip": false,
|
| 303 |
+
"normalized": false,
|
| 304 |
+
"rstrip": false,
|
| 305 |
+
"single_word": false,
|
| 306 |
+
"special": true
|
| 307 |
+
},
|
| 308 |
+
"200038": {
|
| 309 |
+
"content": "<rename_file>",
|
| 310 |
+
"lstrip": false,
|
| 311 |
+
"normalized": false,
|
| 312 |
+
"rstrip": false,
|
| 313 |
+
"single_word": false,
|
| 314 |
+
"special": true
|
| 315 |
+
},
|
| 316 |
+
"200039": {
|
| 317 |
+
"content": "<edit_file>",
|
| 318 |
+
"lstrip": false,
|
| 319 |
+
"normalized": false,
|
| 320 |
+
"rstrip": false,
|
| 321 |
+
"single_word": false,
|
| 322 |
+
"special": true
|
| 323 |
+
},
|
| 324 |
+
"200040": {
|
| 325 |
+
"content": "<commit_message>",
|
| 326 |
+
"lstrip": false,
|
| 327 |
+
"normalized": false,
|
| 328 |
+
"rstrip": false,
|
| 329 |
+
"single_word": false,
|
| 330 |
+
"special": true
|
| 331 |
+
},
|
| 332 |
+
"200041": {
|
| 333 |
+
"content": "<empty_source_file>",
|
| 334 |
+
"lstrip": false,
|
| 335 |
+
"normalized": false,
|
| 336 |
+
"rstrip": false,
|
| 337 |
+
"single_word": false,
|
| 338 |
+
"special": true
|
| 339 |
+
},
|
| 340 |
+
"200042": {
|
| 341 |
+
"content": "<repo_struct>",
|
| 342 |
+
"lstrip": false,
|
| 343 |
+
"normalized": false,
|
| 344 |
+
"rstrip": false,
|
| 345 |
+
"single_word": false,
|
| 346 |
+
"special": true
|
| 347 |
+
},
|
| 348 |
+
"200043": {
|
| 349 |
+
"content": "<code_context>",
|
| 350 |
+
"lstrip": false,
|
| 351 |
+
"normalized": false,
|
| 352 |
+
"rstrip": false,
|
| 353 |
+
"single_word": false,
|
| 354 |
+
"special": true
|
| 355 |
+
},
|
| 356 |
+
"200044": {
|
| 357 |
+
"content": "<file_content>",
|
| 358 |
+
"lstrip": false,
|
| 359 |
+
"normalized": false,
|
| 360 |
+
"rstrip": false,
|
| 361 |
+
"single_word": false,
|
| 362 |
+
"special": true
|
| 363 |
+
},
|
| 364 |
+
"200045": {
|
| 365 |
+
"content": "<source_files>",
|
| 366 |
+
"lstrip": false,
|
| 367 |
+
"normalized": false,
|
| 368 |
+
"rstrip": false,
|
| 369 |
+
"single_word": false,
|
| 370 |
+
"special": true
|
| 371 |
+
},
|
| 372 |
+
"200046": {
|
| 373 |
+
"content": "<pr_start>",
|
| 374 |
+
"lstrip": false,
|
| 375 |
+
"normalized": false,
|
| 376 |
+
"rstrip": false,
|
| 377 |
+
"single_word": false,
|
| 378 |
+
"special": true
|
| 379 |
+
},
|
| 380 |
+
"200047": {
|
| 381 |
+
"content": "<review_comment>",
|
| 382 |
+
"lstrip": false,
|
| 383 |
+
"normalized": false,
|
| 384 |
+
"rstrip": false,
|
| 385 |
+
"single_word": false,
|
| 386 |
+
"special": true
|
| 387 |
+
},
|
| 388 |
+
"200048": {
|
| 389 |
+
"content": "<filepath>",
|
| 390 |
+
"lstrip": false,
|
| 391 |
+
"normalized": false,
|
| 392 |
+
"rstrip": false,
|
| 393 |
+
"single_word": false,
|
| 394 |
+
"special": true
|
| 395 |
+
},
|
| 396 |
+
"200049": {
|
| 397 |
+
"content": "<file_sep>",
|
| 398 |
+
"lstrip": false,
|
| 399 |
+
"normalized": false,
|
| 400 |
+
"rstrip": false,
|
| 401 |
+
"single_word": false,
|
| 402 |
+
"special": true
|
| 403 |
+
},
|
| 404 |
+
"200050": {
|
| 405 |
+
"content": "<think>",
|
| 406 |
+
"lstrip": false,
|
| 407 |
+
"normalized": false,
|
| 408 |
+
"rstrip": false,
|
| 409 |
+
"single_word": false,
|
| 410 |
+
"special": false
|
| 411 |
+
},
|
| 412 |
+
"200051": {
|
| 413 |
+
"content": "</think>",
|
| 414 |
+
"lstrip": false,
|
| 415 |
+
"normalized": false,
|
| 416 |
+
"rstrip": false,
|
| 417 |
+
"single_word": false,
|
| 418 |
+
"special": false
|
| 419 |
+
},
|
| 420 |
+
"200052": {
|
| 421 |
+
"content": "<tool_call>",
|
| 422 |
+
"lstrip": false,
|
| 423 |
+
"normalized": false,
|
| 424 |
+
"rstrip": false,
|
| 425 |
+
"single_word": false,
|
| 426 |
+
"special": false
|
| 427 |
+
},
|
| 428 |
+
"200053": {
|
| 429 |
+
"content": "</tool_call>",
|
| 430 |
+
"lstrip": false,
|
| 431 |
+
"normalized": false,
|
| 432 |
+
"rstrip": false,
|
| 433 |
+
"single_word": false,
|
| 434 |
+
"special": false
|
| 435 |
+
},
|
| 436 |
+
"200054": {
|
| 437 |
+
"content": "]<]frame[>[",
|
| 438 |
+
"lstrip": false,
|
| 439 |
+
"normalized": false,
|
| 440 |
+
"rstrip": false,
|
| 441 |
+
"single_word": false,
|
| 442 |
+
"special": true
|
| 443 |
+
},
|
| 444 |
+
"200055": {
|
| 445 |
+
"content": "]<]start of frame[>[",
|
| 446 |
+
"lstrip": false,
|
| 447 |
+
"normalized": false,
|
| 448 |
+
"rstrip": false,
|
| 449 |
+
"single_word": false,
|
| 450 |
+
"special": true
|
| 451 |
+
},
|
| 452 |
+
"200056": {
|
| 453 |
+
"content": "]<]end of frame[>[",
|
| 454 |
+
"lstrip": false,
|
| 455 |
+
"normalized": false,
|
| 456 |
+
"rstrip": false,
|
| 457 |
+
"single_word": false,
|
| 458 |
+
"special": true
|
| 459 |
+
},
|
| 460 |
+
"200057": {
|
| 461 |
+
"content": "<|content_altered_placeholder|>",
|
| 462 |
+
"lstrip": false,
|
| 463 |
+
"normalized": false,
|
| 464 |
+
"rstrip": false,
|
| 465 |
+
"single_word": false,
|
| 466 |
+
"special": true
|
| 467 |
+
},
|
| 468 |
+
"200058": {
|
| 469 |
+
"content": "]<]minimax[>[",
|
| 470 |
+
"lstrip": false,
|
| 471 |
+
"normalized": false,
|
| 472 |
+
"rstrip": false,
|
| 473 |
+
"single_word": false,
|
| 474 |
+
"special": false
|
| 475 |
+
},
|
| 476 |
+
"200059": {
|
| 477 |
+
"content": "<mm:think>",
|
| 478 |
+
"lstrip": false,
|
| 479 |
+
"normalized": false,
|
| 480 |
+
"rstrip": false,
|
| 481 |
+
"single_word": false,
|
| 482 |
+
"special": false
|
| 483 |
+
},
|
| 484 |
+
"200060": {
|
| 485 |
+
"content": "</mm:think>",
|
| 486 |
+
"lstrip": false,
|
| 487 |
+
"normalized": false,
|
| 488 |
+
"rstrip": false,
|
| 489 |
+
"single_word": false,
|
| 490 |
+
"special": false
|
| 491 |
+
}
|
| 492 |
+
},
|
| 493 |
+
"bos_token": "]~b]",
|
| 494 |
+
"clean_up_tokenization_spaces": false,
|
| 495 |
+
"eos_token": "[e~[",
|
| 496 |
+
"pad_token": "]!p~[",
|
| 497 |
+
"model_max_length": 40960000,
|
| 498 |
+
"tokenizer_class": "PreTrainedTokenizerFast",
|
| 499 |
+
"unk_token": "[e~["
|
| 500 |
+
}
|
| 501 |
+
|
video_processor.py
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright 2023-2024 SGLang Team
|
| 2 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 3 |
+
"""
|
| 4 |
+
MiniMax VL family HuggingFace-compatible VideoProcessor.
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
import math
|
| 8 |
+
from typing import List, Optional, Tuple, Union
|
| 9 |
+
|
| 10 |
+
import torch
|
| 11 |
+
import torchvision
|
| 12 |
+
from torchvision.transforms import InterpolationMode
|
| 13 |
+
from transformers import BatchFeature
|
| 14 |
+
from transformers.image_utils import PILImageResampling, SizeDict
|
| 15 |
+
from transformers.processing_utils import (
|
| 16 |
+
Unpack,
|
| 17 |
+
VideosKwargs,
|
| 18 |
+
)
|
| 19 |
+
from transformers.utils import TensorType
|
| 20 |
+
from transformers.video_processing_utils import BaseVideoProcessor
|
| 21 |
+
from transformers.video_utils import group_videos_by_shape, reorder_videos
|
| 22 |
+
|
| 23 |
+
MAX_RATIO = 200
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def round_by_factor(number: int, factor: int) -> int:
|
| 27 |
+
return round(number / factor) * factor
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
def ceil_by_factor(number: int, factor: int) -> int:
|
| 31 |
+
return math.ceil(number / factor) * factor
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
def floor_by_factor(number: int, factor: int) -> int:
|
| 35 |
+
return math.floor(number / factor) * factor
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
def smart_resize(
|
| 39 |
+
height: int,
|
| 40 |
+
width: int,
|
| 41 |
+
factor: int = 28,
|
| 42 |
+
min_pixels: int = 4 * 28 * 28,
|
| 43 |
+
max_pixels: int = 451584,
|
| 44 |
+
) -> tuple[int, int]:
|
| 45 |
+
if max(height, width) / min(height, width) > MAX_RATIO:
|
| 46 |
+
raise ValueError(
|
| 47 |
+
f"absolute aspect ratio must be smaller than {MAX_RATIO}, "
|
| 48 |
+
f"got {max(height, width) / min(height, width)}"
|
| 49 |
+
)
|
| 50 |
+
h_bar = max(factor, round_by_factor(height, factor))
|
| 51 |
+
w_bar = max(factor, round_by_factor(width, factor))
|
| 52 |
+
if h_bar * w_bar > max_pixels:
|
| 53 |
+
beta = math.sqrt((height * width) / max_pixels)
|
| 54 |
+
h_bar = floor_by_factor(height / beta, factor)
|
| 55 |
+
w_bar = floor_by_factor(width / beta, factor)
|
| 56 |
+
elif h_bar * w_bar < min_pixels:
|
| 57 |
+
beta = math.sqrt(min_pixels / (height * width))
|
| 58 |
+
h_bar = ceil_by_factor(height * beta, factor)
|
| 59 |
+
w_bar = ceil_by_factor(width * beta, factor)
|
| 60 |
+
return h_bar, w_bar
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
class MiniMaxM3VLVideoProcessorKwargs(VideosKwargs, total=False):
|
| 64 |
+
patch_size: int
|
| 65 |
+
temporal_patch_size: int
|
| 66 |
+
merge_size: int
|
| 67 |
+
min_pixels: int
|
| 68 |
+
max_pixels: int
|
| 69 |
+
total_pixels: int
|
| 70 |
+
min_frames: int
|
| 71 |
+
max_frames: int
|
| 72 |
+
fps: float | int
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
class MiniMaxM3VLVideoProcessor(BaseVideoProcessor):
|
| 76 |
+
do_resize = True
|
| 77 |
+
resample = PILImageResampling.BICUBIC
|
| 78 |
+
size = {"height": 672, "width": 672}
|
| 79 |
+
default_to_square = False
|
| 80 |
+
do_rescale = True
|
| 81 |
+
rescale_factor = 1 / 255
|
| 82 |
+
do_normalize = True
|
| 83 |
+
image_mean = [0.48145466, 0.4578275, 0.40821073]
|
| 84 |
+
image_std = [0.26862954, 0.26130258, 0.27577711]
|
| 85 |
+
do_convert_rgb = True
|
| 86 |
+
do_sample_frames = False
|
| 87 |
+
patch_size = 14
|
| 88 |
+
temporal_patch_size = 2
|
| 89 |
+
merge_size = 2
|
| 90 |
+
min_pixels = 4 * 28 * 28
|
| 91 |
+
max_pixels = 768 * 28 * 28 # 602,112
|
| 92 |
+
total_pixels = int(64000 * 28 * 28 * 0.9) # ~45M, ~64k tokens budget
|
| 93 |
+
fps = 1.0
|
| 94 |
+
min_frames = 4
|
| 95 |
+
max_frames = 768
|
| 96 |
+
valid_kwargs = MiniMaxM3VLVideoProcessorKwargs
|
| 97 |
+
model_input_names = ["pixel_values_videos", "video_grid_thw"]
|
| 98 |
+
|
| 99 |
+
def __init__(self, **kwargs: Unpack[MiniMaxM3VLVideoProcessorKwargs]):
|
| 100 |
+
super().__init__(**kwargs)
|
| 101 |
+
|
| 102 |
+
def _preprocess(
|
| 103 |
+
self,
|
| 104 |
+
videos: List[torch.Tensor],
|
| 105 |
+
do_convert_rgb: bool,
|
| 106 |
+
do_resize: bool,
|
| 107 |
+
size: SizeDict,
|
| 108 |
+
resample: PILImageResampling | InterpolationMode | int | None,
|
| 109 |
+
do_rescale: bool,
|
| 110 |
+
rescale_factor: float,
|
| 111 |
+
do_normalize: bool,
|
| 112 |
+
image_mean: float | List[float] | None,
|
| 113 |
+
image_std: float | List[float] | None,
|
| 114 |
+
patch_size: int,
|
| 115 |
+
temporal_patch_size: int,
|
| 116 |
+
merge_size: int,
|
| 117 |
+
min_pixels: int,
|
| 118 |
+
max_pixels: int,
|
| 119 |
+
return_tensors: str | TensorType | None = None,
|
| 120 |
+
**kwargs,
|
| 121 |
+
) -> BatchFeature:
|
| 122 |
+
grouped_videos, grouped_videos_index = group_videos_by_shape(videos)
|
| 123 |
+
resized_videos_grouped = {}
|
| 124 |
+
factor = patch_size * merge_size
|
| 125 |
+
for shape, stacked_videos in grouped_videos.items():
|
| 126 |
+
batch_size, num_frames, channels, height, width = stacked_videos.shape
|
| 127 |
+
resized_height, resized_width = height, width
|
| 128 |
+
if do_resize:
|
| 129 |
+
resized_height, resized_width = smart_resize(
|
| 130 |
+
height, width, factor=factor,
|
| 131 |
+
min_pixels=min_pixels, max_pixels=max_pixels,
|
| 132 |
+
)
|
| 133 |
+
stacked_videos = stacked_videos.view(
|
| 134 |
+
batch_size * num_frames, channels, height, width
|
| 135 |
+
)
|
| 136 |
+
stacked_videos = self.resize(
|
| 137 |
+
stacked_videos,
|
| 138 |
+
size=SizeDict(height=resized_height, width=resized_width),
|
| 139 |
+
resample=resample,
|
| 140 |
+
)
|
| 141 |
+
stacked_videos = stacked_videos.view(
|
| 142 |
+
batch_size,
|
| 143 |
+
num_frames,
|
| 144 |
+
channels,
|
| 145 |
+
resized_height,
|
| 146 |
+
resized_width,
|
| 147 |
+
)
|
| 148 |
+
resized_videos_grouped[shape] = stacked_videos
|
| 149 |
+
resized_videos = reorder_videos(resized_videos_grouped, grouped_videos_index)
|
| 150 |
+
|
| 151 |
+
grouped_videos, grouped_videos_index = group_videos_by_shape(resized_videos)
|
| 152 |
+
processed_videos_grouped = {}
|
| 153 |
+
processed_grids = {}
|
| 154 |
+
for shape, stacked_videos in grouped_videos.items():
|
| 155 |
+
resized_height, resized_width = stacked_videos.shape[-2:]
|
| 156 |
+
patches = self.rescale_and_normalize(
|
| 157 |
+
stacked_videos,
|
| 158 |
+
do_rescale,
|
| 159 |
+
rescale_factor,
|
| 160 |
+
do_normalize,
|
| 161 |
+
image_mean,
|
| 162 |
+
image_std,
|
| 163 |
+
)
|
| 164 |
+
|
| 165 |
+
if pad := -patches.shape[1] % temporal_patch_size:
|
| 166 |
+
repeats = patches[:, -1:].expand(-1, pad, -1, -1, -1)
|
| 167 |
+
patches = torch.cat([patches, repeats], dim=1)
|
| 168 |
+
|
| 169 |
+
batch_size, grid_t, channels = patches.shape[:3]
|
| 170 |
+
grid_t = grid_t // temporal_patch_size
|
| 171 |
+
grid_h, grid_w = resized_height // patch_size, resized_width // patch_size
|
| 172 |
+
|
| 173 |
+
patches = patches.view(
|
| 174 |
+
batch_size,
|
| 175 |
+
grid_t,
|
| 176 |
+
temporal_patch_size,
|
| 177 |
+
channels,
|
| 178 |
+
grid_h // merge_size,
|
| 179 |
+
merge_size,
|
| 180 |
+
patch_size,
|
| 181 |
+
grid_w // merge_size,
|
| 182 |
+
merge_size,
|
| 183 |
+
patch_size,
|
| 184 |
+
)
|
| 185 |
+
patches = patches.permute(0, 1, 4, 7, 5, 8, 3, 2, 6, 9)
|
| 186 |
+
flatten_patches = patches.reshape(
|
| 187 |
+
batch_size,
|
| 188 |
+
grid_t * grid_h * grid_w,
|
| 189 |
+
channels * temporal_patch_size * patch_size * patch_size,
|
| 190 |
+
)
|
| 191 |
+
|
| 192 |
+
processed_videos_grouped[shape] = flatten_patches
|
| 193 |
+
processed_grids[shape] = [[grid_t, grid_h, grid_w]] * batch_size
|
| 194 |
+
|
| 195 |
+
processed_videos = reorder_videos(
|
| 196 |
+
processed_videos_grouped, grouped_videos_index
|
| 197 |
+
)
|
| 198 |
+
processed_grids = reorder_videos(processed_grids, grouped_videos_index)
|
| 199 |
+
pixel_values_videos = torch.cat(processed_videos, dim=0)
|
| 200 |
+
video_grid_thw = torch.tensor(processed_grids, dtype=torch.long)
|
| 201 |
+
|
| 202 |
+
return BatchFeature(
|
| 203 |
+
data={
|
| 204 |
+
"pixel_values_videos": pixel_values_videos,
|
| 205 |
+
"video_grid_thw": video_grid_thw,
|
| 206 |
+
},
|
| 207 |
+
tensor_type=return_tensors,
|
| 208 |
+
)
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|