Minimax VL 01
MiniMax-VL-01是一個強大的多模態大語言模型,採用'ViT-MLP-LLM'框架,具有動態分辨率處理能力,在多項視覺語言任務中表現優異。
Downloads 237
Release Time : 1/12/2025
Model Overview
該模型結合了視覺變換器(ViT)、MLP投影器和基礎大語言模型,能夠處理從336×336到2016×2016的動態分辨率圖像輸入,在多模態任務中展現出頂級性能。
Model Features
動態分辨率處理
支持從336×336到2016×2016的動態分辨率輸入,保留縮略圖並分割編碼
大規模訓練
視覺變換器在6.94億圖像-標題對上訓練,共處理5120億token
多模態能力
結合視覺和語言理解,在複雜多模態任務中表現優異
Model Capabilities
圖像理解
視覺問答
文檔分析
圖表理解
數學推理
科學問題解答
Use Cases
教育
科學問題解答
解答包含圖表和公式的科學問題
在MMMU和MMMU-Pro基準測試中表現優異
文檔處理
文檔問答
從文檔中提取信息並回答問題
在DocVQA基準測試中達到96.4%準確率
數據分析
圖表理解
分析和解釋圖表數據
在ChartQA基準測試中達到91.7%準確率
🚀 MiniMax-VL-01
MiniMax-VL-01 模型採用 “ViT-MLP-LLM” 框架,這是多模態大語言模型領域常用的技術。該模型通過視覺編碼、圖像適配和基礎大語言模型三部分進行初始化和訓練,具有動態分辨率特性,在多模態排行榜上達到了頂級性能,展現出在複雜多模態任務中的優勢和可靠性。
🚀 快速開始
這裡我們提供一個加載分詞器和模型以生成內容的簡單示例。
from transformers import AutoModelForCausalLM, AutoProcessor, AutoConfig, QuantoConfig, GenerationConfig
import torch
import json
import os
from PIL import Image
# load hf config
hf_config = AutoConfig.from_pretrained("MiniMaxAI/MiniMax-VL-01", trust_remote_code=True)
# quantization config, int8 is recommended
quantization_config = QuantoConfig(
weights="int8",
modules_to_not_convert=[
"vision_tower",
"image_newline",
"multi_modal_projector",
"lm_head",
"embed_tokens",
] + [f"model.layers.{i}.coefficient" for i in range(hf_config.text_config.num_hidden_layers)]
+ [f"model.layers.{i}.block_sparse_moe.gate" for i in range(hf_config.text_config.num_hidden_layers)]
)
# set device map
model_safetensors_index_path = os.path.join("MiniMax-VL-01", "model.safetensors.index.json")
with open(model_safetensors_index_path, "r") as f:
model_safetensors_index = json.load(f)
weight_map = model_safetensors_index['weight_map']
vision_map = {}
for key, value in weight_map.items():
if 'vision_tower' in key or 'image_newline' in key or 'multi_modal_projector' in key:
new_key = key.replace('.weight','').replace('.bias','')
if new_key not in vision_map:
vision_map[new_key] = value
# assume 8 GPUs
world_size = 8
device_map = {
'language_model.model.embed_tokens': 'cuda:0',
'language_model.model.norm': f'cuda:{world_size - 1}',
'language_model.lm_head': f'cuda:{world_size - 1}'
}
for key, value in vision_map.items():
device_map[key] = f'cuda:0'
device_map['vision_tower.vision_model.post_layernorm'] = f'cuda:0'
layers_per_device = hf_config.text_config.num_hidden_layers // world_size
for i in range(world_size):
for j in range(layers_per_device):
device_map[f'language_model.model.layers.{i * layers_per_device + j}'] = f'cuda:{i}'
# load processor
processor = AutoProcessor.from_pretrained("MiniMaxAI/MiniMax-VL-01", trust_remote_code=True)
messages = [
{"role": "system", "content": [{"type": "text", "text": "You are a helpful assistant created by MiniMax based on MiniMax-VL-01 model."}]},
{"role": "user", "content": [{"type": "image", "image": "placeholder"},{"type": "text", "text": "Describe this image."}]},
]
prompt = processor.tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
raw_image = Image.open("figures/image.jpg")
# tokenize and move to device
model_inputs = processor(images=[raw_image], text=prompt, return_tensors='pt').to('cuda').to(torch.bfloat16)
# load bfloat16 model, move to device, and apply quantization
quantized_model = AutoModelForCausalLM.from_pretrained(
"MiniMaxAI/MiniMax-VL-01",
torch_dtype="bfloat16",
device_map=device_map,
quantization_config=quantization_config,
trust_remote_code=True,
offload_buffers=True,
)
generation_config = GenerationConfig(
max_new_tokens=100,
eos_token_id=200020,
use_cache=True,
)
# generate response
generated_ids = quantized_model.generate(**model_inputs, generation_config=generation_config)
print(f"generated_ids: {generated_ids}")
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = processor.tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
✨ 主要特性
- 採用 “ViT-MLP-LLM” 框架:這是多模態大語言模型領域常用的技術,模型由三部分初始化和訓練,包括一個 3 億 300 萬參數的視覺變換器(ViT)用於視覺編碼、一個隨機初始化的兩層 MLP 投影器用於圖像適配,以及 MiniMax-Text-01 作為基礎大語言模型。
- 動態分辨率特性:輸入圖像會根據預設網格進行調整大小,分辨率從 336×336 到 2016×2016 不等,同時保留一個 336×336 的縮略圖。調整後的圖像被分割成相同大小的非重疊塊,這些塊和縮略圖分別進行編碼,然後組合以形成完整的圖像表示。
- 大量訓練數據:訓練數據包括字幕、描述和指令數據。視覺變換器(ViT)在 6.94 億個圖像 - 字幕對上從頭開始訓練。在訓練管道的四個不同階段,總共處理了 5120 億個標記,利用這些大量數據賦予模型強大的能力。
- 頂級性能:在多模態排行榜上達到了頂級性能,展示了其在複雜多模態任務中的優勢和可靠性。
- 支持函數調用:支持函數調用功能,使模型能夠智能識別何時需要調用外部函數,並以結構化的 JSON 格式輸出參數。
📦 安裝指南
文檔未提供具體安裝步驟,可參考相關依賴庫的安裝說明進行安裝,如 transformers
、torch
等。
💻 使用示例
基礎用法
from transformers import AutoModelForCausalLM, AutoProcessor, AutoConfig, QuantoConfig, GenerationConfig
import torch
import json
import os
from PIL import Image
# load hf config
hf_config = AutoConfig.from_pretrained("MiniMaxAI/MiniMax-VL-01", trust_remote_code=True)
# quantization config, int8 is recommended
quantization_config = QuantoConfig(
weights="int8",
modules_to_not_convert=[
"vision_tower",
"image_newline",
"multi_modal_projector",
"lm_head",
"embed_tokens",
] + [f"model.layers.{i}.coefficient" for i in range(hf_config.text_config.num_hidden_layers)]
+ [f"model.layers.{i}.block_sparse_moe.gate" for i in range(hf_config.text_config.num_hidden_layers)]
)
# set device map
model_safetensors_index_path = os.path.join("MiniMax-VL-01", "model.safetensors.index.json")
with open(model_safetensors_index_path, "r") as f:
model_safetensors_index = json.load(f)
weight_map = model_safetensors_index['weight_map']
vision_map = {}
for key, value in weight_map.items():
if 'vision_tower' in key or 'image_newline' in key or 'multi_modal_projector' in key:
new_key = key.replace('.weight','').replace('.bias','')
if new_key not in vision_map:
vision_map[new_key] = value
# assume 8 GPUs
world_size = 8
device_map = {
'language_model.model.embed_tokens': 'cuda:0',
'language_model.model.norm': f'cuda:{world_size - 1}',
'language_model.lm_head': f'cuda:{world_size - 1}'
}
for key, value in vision_map.items():
device_map[key] = f'cuda:0'
device_map['vision_tower.vision_model.post_layernorm'] = f'cuda:0'
layers_per_device = hf_config.text_config.num_hidden_layers // world_size
for i in range(world_size):
for j in range(layers_per_device):
device_map[f'language_model.model.layers.{i * layers_per_device + j}'] = f'cuda:{i}'
# load processor
processor = AutoProcessor.from_pretrained("MiniMaxAI/MiniMax-VL-01", trust_remote_code=True)
messages = [
{"role": "system", "content": [{"type": "text", "text": "You are a helpful assistant created by MiniMax based on MiniMax-VL-01 model."}]},
{"role": "user", "content": [{"type": "image", "image": "placeholder"},{"type": "text", "text": "Describe this image."}]},
]
prompt = processor.tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
raw_image = Image.open("figures/image.jpg")
# tokenize and move to device
model_inputs = processor(images=[raw_image], text=prompt, return_tensors='pt').to('cuda').to(torch.bfloat16)
# load bfloat16 model, move to device, and apply quantization
quantized_model = AutoModelForCausalLM.from_pretrained(
"MiniMaxAI/MiniMax-VL-01",
torch_dtype="bfloat16",
device_map=device_map,
quantization_config=quantization_config,
trust_remote_code=True,
offload_buffers=True,
)
generation_config = GenerationConfig(
max_new_tokens=100,
eos_token_id=200020,
use_cache=True,
)
# generate response
generated_ids = quantized_model.generate(**model_inputs, generation_config=generation_config)
print(f"generated_ids: {generated_ids}")
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = processor.tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
📚 詳細文檔
評估
任務 | GPT - 4o (11 - 20) |
Claude - 3.5 - Sonnet (10 - 22) | Gemini - 1.5 - Pro (002) | Gemini - 2.0 - Flash (exp) | Qwen2 - VL - 72B - Inst. | InternVL2.5 - 78B | LLama - 3.2 - 90B | MiniMax - VL - 01 |
---|---|---|---|---|---|---|---|---|
知識 | ||||||||
MMMU* | 68.5 | |||||||
MMMU - Pro* | 52.7 | |||||||
視覺問答 | ||||||||
ChartQA*relaxed | 91.7 | |||||||
DocVQA* | 96.4 | |||||||
OCRBench | 865 | |||||||
數學與科學 | ||||||||
AI2D* | 83.3 | |||||||
MathVista* | 68.6 | |||||||
OlympiadBenchfull | 24.2 | |||||||
長上下文 | ||||||||
M - LongDocacc | 32.5 | |||||||
綜合 | ||||||||
MEGA - Benchmacro | 47.4 | |||||||
用戶體驗 | ||||||||
In - house Benchmark | 56.6 |
* 按照 0-shot CoT 設置進行評估。
部署指南
對於生產部署,建議使用 vLLM 來服務 MiniMax-VL-01。vLLM 為服務大語言模型提供了出色的性能,具有以下特點:
- 🔥 出色的服務吞吐量性能
- ⚡ 高效智能的內存管理
- 📦 強大的批量請求處理能力
- ⚙️ 深度優化的底層性能
詳細的部署說明,請參考 vLLM 部署指南。
函數調用
MiniMax-VL-01 支持函數調用功能,使模型能夠智能識別何時需要調用外部函數,並以結構化的 JSON 格式輸出參數。通過函數調用,你可以:
- 讓模型識別用戶請求中隱含的函數調用需求。
- 接收結構化的參數輸出,以便無縫集成到應用程序中。
- 支持各種複雜的參數類型,包括嵌套對象和數組。
函數調用支持標準的 OpenAI 兼容格式定義,並與 Transformers 庫無縫集成。詳細的使用說明,請參考 函數調用指南 或 中文指南。
引用
@misc{minimax2025minimax01scalingfoundationmodels,
title={MiniMax-01: Scaling Foundation Models with Lightning Attention},
author={MiniMax and Aonian Li and Bangwei Gong and Bo Yang and Boji Shan and Chang Liu and Cheng Zhu and Chunhao Zhang and Congchao Guo and Da Chen and Dong Li and Enwei Jiao and Gengxin Li and Guojun Zhang and Haohai Sun and Houze Dong and Jiadai Zhu and Jiaqi Zhuang and Jiayuan Song and Jin Zhu and Jingtao Han and Jingyang Li and Junbin Xie and Junhao Xu and Junjie Yan and Kaishun Zhang and Kecheng Xiao and Kexi Kang and Le Han and Leyang Wang and Lianfei Yu and Liheng Feng and Lin Zheng and Linbo Chai and Long Xing and Meizhi Ju and Mingyuan Chi and Mozhi Zhang and Peikai Huang and Pengcheng Niu and Pengfei Li and Pengyu Zhao and Qi Yang and Qidi Xu and Qiexiang Wang and Qin Wang and Qiuhui Li and Ruitao Leng and Shengmin Shi and Shuqi Yu and Sichen Li and Songquan Zhu and Tao Huang and Tianrun Liang and Weigao Sun and Weixuan Sun and Weiyu Cheng and Wenkai Li and Xiangjun Song and Xiao Su and Xiaodong Han and Xinjie Zhang and Xinzhu Hou and Xu Min and Xun Zou and Xuyang Shen and Yan Gong and Yingjie Zhu and Yipeng Zhou and Yiran Zhong and Yongyi Hu and Yuanxiang Fan and Yue Yu and Yufeng Yang and Yuhao Li and Yunan Huang and Yunji Li and Yunpeng Huang and Yunzhi Xu and Yuxin Mao and Zehan Li and Zekang Li and Zewei Tao and Zewen Ying and Zhaoyang Cong and Zhen Qin and Zhenhua Fan and Zhihang Yu and Zhuo Jiang and Zijia Wu},
year={2025},
eprint={2501.08313},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2501.08313},
}
聊天機器人與 API
為了方便一般使用和評估,我們提供了一個帶有在線搜索功能的 聊天機器人 和麵向開發者的 在線 API。此外,還提供了具有視頻生成、圖像生成、語音合成和語音克隆功能的 MiniMax MCP 服務器 供開發者使用。
聯繫我們
如有任何問題,請通過 model@minimaxi.com 聯繫我們。
📄 許可證
- 模型許可證:Model Agreement
- 代碼許可證:MIT
Clip Vit Large Patch14
CLIP是由OpenAI開發的視覺-語言模型,通過對比學習將圖像和文本映射到共享的嵌入空間,支持零樣本圖像分類
圖像生成文本
C
openai
44.7M
1,710
Clip Vit Base Patch32
CLIP是由OpenAI開發的多模態模型,能夠理解圖像和文本之間的關係,支持零樣本圖像分類任務。
圖像生成文本
C
openai
14.0M
666
Siglip So400m Patch14 384
Apache-2.0
SigLIP是基於WebLi數據集預訓練的視覺語言模型,採用改進的sigmoid損失函數,優化了圖像-文本匹配任務。
圖像生成文本
Transformers

S
google
6.1M
526
Clip Vit Base Patch16
CLIP是由OpenAI開發的多模態模型,通過對比學習將圖像和文本映射到共享的嵌入空間,實現零樣本圖像分類能力。
圖像生成文本
C
openai
4.6M
119
Blip Image Captioning Base
Bsd-3-clause
BLIP是一個先進的視覺-語言預訓練模型,擅長圖像描述生成任務,支持條件式和非條件式文本生成。
圖像生成文本
Transformers

B
Salesforce
2.8M
688
Blip Image Captioning Large
Bsd-3-clause
BLIP是一個統一的視覺-語言預訓練框架,擅長圖像描述生成任務,支持條件式和無條件式圖像描述生成。
圖像生成文本
Transformers

B
Salesforce
2.5M
1,312
Openvla 7b
MIT
OpenVLA 7B是一個基於Open X-Embodiment數據集訓練的開源視覺-語言-動作模型,能夠根據語言指令和攝像頭圖像生成機器人動作。
圖像生成文本
Transformers English

O
openvla
1.7M
108
Llava V1.5 7b
LLaVA 是一款開源多模態聊天機器人,基於 LLaMA/Vicuna 微調,支持圖文交互。
圖像生成文本
Transformers

L
liuhaotian
1.4M
448
Vit Gpt2 Image Captioning
Apache-2.0
這是一個基於ViT和GPT2架構的圖像描述生成模型,能夠為輸入圖像生成自然語言描述。
圖像生成文本
Transformers

V
nlpconnect
939.88k
887
Blip2 Opt 2.7b
MIT
BLIP-2是一個視覺語言模型,結合了圖像編碼器和大型語言模型,用於圖像到文本的生成任務。
圖像生成文本
Transformers English

B
Salesforce
867.78k
359
Featured Recommended AI Models
Llama 3 Typhoon V1.5x 8b Instruct
專為泰語設計的80億參數指令模型,性能媲美GPT-3.5-turbo,優化了應用場景、檢索增強生成、受限生成和推理任務
大型語言模型
Transformers Supports Multiple Languages

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-Tiny是一個基於SODA數據集訓練的超小型對話模型,專為邊緣設備推理設計,體積僅為Cosmo-3B模型的2%左右。
對話系統
Transformers English

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
基於RoBERTa架構的中文抽取式問答模型,適用於從給定文本中提取答案的任務。
問答系統 Chinese
R
uer
2,694
98