Image-Text-to-Text
MLX
Safetensors
Japanese
qwen2_5_vl
japanese
document-understanding
quantized
conversational
4-bit precision
Instructions to use tokimoa/Stockmark-DocReasoner-Qwen2.5-VL-32B-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use tokimoa/Stockmark-DocReasoner-Qwen2.5-VL-32B-MLX-4bit with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("tokimoa/Stockmark-DocReasoner-Qwen2.5-VL-32B-MLX-4bit") config = load_config("tokimoa/Stockmark-DocReasoner-Qwen2.5-VL-32B-MLX-4bit") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
Stockmark-DocReasoner-Qwen2.5-VL-32B (MLX 4bit, verified)
Stockmarkの Stockmark-DocReasoner-Qwen2.5-VL-32B(日本語ドキュメント理解・推論特化VLM。製造業ドメイン強化・GENIAC支援・CoT推論対応)を、公式BF16重みからMLX 4bit(group size 64、実効4.74bpw)に量子化したものです。日本語ビジネス文書での検証済みで公開しています。
データを外に出せない環境で、請求書・議事録・契約書・チェックシート等の日本語文書を画像のまま読解・推論できます。
⚠️ 重要: mlx-vlm はバージョン 0.6.3 を使ってください
pip install mlx-vlm==0.6.3
mlx-vlm 0.6.4以降にはQwen2.5-VL系の画像経路のregressionがあり(Blaizzy/mlx-vlm#1526 関連)、本モデルに限らずQwen2.5-VL系MLXモデル全般で「画像入力時のみ即EOS・ガベージ出力」になります(テキストのみだと正常に動くため気づきにくい)。0.6.3では正常動作します。当方で0.6.3 / 0.6.6 / 0.6.7を実測比較して確認済みです。
変換品質の検証(tokimoa)
日本語ビジネス文書5種(請求書・議事録・契約条項・チェックシート・技術文書)に対する正解既知のQA 6問で検証:
- 6/6問正解(合計金額・表内の数量単価・×項目の特定・担当変更・条項の存続期間・数値指標の読み取り)
- 同一入力の反復で出力完全一致(決定論的)
<think>...</think>で日本語のCoT推論を出力後、<answer>...</answer>で回答する形式
実測速度(M4 Max 36GB)
- 生成: 16.9 tok/s / プロンプト処理: 109.9 tok/s(画像2,500トークン級)
- ピークメモリ: 21.3GB(重み18GB)
使い方
# pip install mlx-vlm==0.6.3
from mlx_vlm import load, generate
model, processor = load("tokimoa/Stockmark-DocReasoner-Qwen2.5-VL-32B-MLX-4bit")
messages = [{"role":"user","content":[{"type":"image"},{"type":"text","text":"この請求書の合計金額はいくらですか?"}]}]
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
out = generate(model, processor, text, image=["invoice.png"], max_tokens=800, temperature=0.0)
print(out.text)
変換情報
- 変換元:
stockmark/Stockmark-DocReasoner-Qwen2.5-VL-32B(公式BF16、commit 445c725) - 変換:
mlx-vlm 0.6.7convert -q --q-bits 4(重み形式は0.6.3ランタイムで互換動作を確認済み) - 変換者: tokimoa
ライセンス
Apache-2.0(元モデルに準拠)
- Downloads last month
- 11
Model size
6B params
Tensor type
BF16
·
U32 ·
Hardware compatibility
Log In to add your hardware
4-bit
Model tree for tokimoa/Stockmark-DocReasoner-Qwen2.5-VL-32B-MLX-4bit
Base model
Qwen/Qwen2.5-VL-32B-Instruct