OvisOCR2 (MLX bf16, verified)

OvisOCR2๏ผˆ0.9Bใฎend-to-endใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใƒ‘ใƒผใ‚นใƒขใƒ‡ใƒซใ€‚OmniDocBench v1.6้ฆ–ไฝ๏ผ‰ใ‚’ๅ…ฌๅผbf16้‡ใฟใ‹ใ‚‰MLXๅฝขๅผใซๅค‰ๆ›ใ—ใŸใ‚‚ใฎใงใ™ใ€‚ๆ—ฅๆœฌ่ชžใƒ“ใ‚ธใƒใ‚นๆ–‡ๆ›ธใงใฎๆคœ่จผๆธˆใฟใงๅ…ฌ้–‹ใ—ใฆใ„ใพใ™ใ€‚

ใƒšใƒผใ‚ธ็”ปๅƒใ‚’ๅ…ฅๅŠ›ใ™ใ‚‹ใจใ€่ชญใฟ้ †ใฉใŠใ‚ŠใฎMarkdown๏ผˆ่กจใฏHTMLใ€ๆ•ฐๅผใฏLaTeX๏ผ‰ใ‚’ๅ‡บๅŠ›ใ—ใพใ™ใ€‚

ๅค‰ๆ›ๅ“่ณชใฎๆคœ่จผ๏ผˆtokimoa๏ผ‰

ๆ—ฅๆœฌ่ชžใƒ“ใ‚ธใƒใ‚นๆ–‡ๆ›ธ5็จฎ๏ผˆ่ญฐไบ‹้Œฒใƒป่ซ‹ๆฑ‚ๆ›ธใƒปๅฅ‘็ด„ๆก้ …ใƒปใƒใ‚งใƒƒใ‚ฏใ‚ทใƒผใƒˆใƒป่‹ฑๆ—ฅๆททๅœจ๏ผ‰ใงๆคœ่จผ:

  • transformers็‰ˆ๏ผˆfp32ใƒปgreedy๏ผ‰ใจ5/5็”ปๅƒใงๅ‡บๅŠ›ๅฎŒๅ…จไธ€่‡ด
  • ๅŒไธ€ๅ…ฅๅŠ›ใฎๅๅพฉใงๅ‡บๅŠ›ๅฎŒๅ…จไธ€่‡ด(ๆฑบๅฎš่ซ–็š„)
  • ๅฎŸๅŠน้€Ÿๅบฆ: 5ๆžšๅˆ่จˆ ็ด„9.3็ง’๏ผˆM4 Maxใ€ใƒขใƒ‡ใƒซใƒญใƒผใƒ‰่พผใฟ๏ผ‰

ไฝฟใ„ๆ–น

# pip install mlx-vlm
from mlx_vlm import load, generate

model, processor = load("tokimoa/ovisocr2-mlx-bf16")
prompt = "Extract all readable content from the image in natural human reading order and output the result as a single Markdown document. For charts or images, represent them using an HTML image tag: <img src=\"images/bbox_{left}_{top}_{right}_{bottom}.jpg\" />, where left, top, right, bottom are bounding box coordinates scaled to [0, 1000). Format formulas as LaTeX. Format tables as HTML: <table>...</table>. Transcribe all other text as standard Markdown. Preserve the original text without translation or paraphrasing."
messages = [{"role":"user","content":[{"type":"image"},{"type":"text","text":prompt}]}]
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=False)
out = generate(model, processor, text, image=["page.png"], max_tokens=4096, temperature=0.0, verbose=False)
print(out.text)

ๅค‰ๆ›ๆƒ…ๅ ฑ

  • ๅค‰ๆ›ๅ…ƒ: ATH-MaaS/OvisOCR2๏ผˆbf16ใ€Qwen3.5็ณป linear+full attentionใƒใ‚คใƒ–ใƒชใƒƒใƒ‰๏ผ‰
  • ๅค‰ๆ›: mlx-vlm 0.6.7 convert๏ผˆ้‡ๅญๅŒ–ใชใ—ใƒปbf16ใ€1.7GB๏ผ‰
  • ๅค‰ๆ›่€…: tokimoa

่ฃœ่ถณ: transformersใงๅ…ƒใƒขใƒ‡ใƒซใ‚’ๅ‹•ใ‹ใ™ๅ ดๅˆใฎๆณจๆ„

ๅ…ƒใƒชใƒใ‚ธใƒˆใƒชใซใฏ generation_config.json ใŒๅŒๆขฑใ•ใ‚ŒใฆใŠใ‚‰ใšใ€config.json ใฎ eos_token_id ใฏ <|endoftext|> (248044) ใ‚’ๆŒ‡ใ—ใฆใ„ใพใ™ใ€‚ๅฎŸ้š›ใฎใ‚ฟใƒผใƒณ็ต‚็ซฏใฏ <|im_end|> (248046) ใฎใŸใ‚ใ€transformersใฎ generate() ใซใใฎใพใพๆธกใ™ใจๅœๆญขใ›ใšๆ–‡ๆ›ธใ‚’็นฐใ‚Š่ฟ”ใ—็”Ÿๆˆใ—ใพใ™ใ€‚eos_token_id=248046 ใ‚’ๆ˜Ž็คบใ—ใฆใใ ใ•ใ„๏ผˆmlx-vlmใƒปvLLMใฏtokenizerๅดใฎEOSใ‚’ไฝฟใ†ใŸใ‚ๅฝฑ้Ÿฟใชใ—๏ผ‰ใ€‚

ใƒฉใ‚คใ‚ปใƒณใ‚น

Apache-2.0๏ผˆๅ…ƒใƒขใƒ‡ใƒซใซๆบ–ๆ‹ ๏ผ‰

Downloads last month
20
Safetensors
Model size
0.9B params
Tensor type
BF16
ยท
MLX
Hardware compatibility
Log In to add your hardware

Quantized

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for tokimoa/ovisocr2-mlx-bf16

Finetuned
(5)
this model