#241·GLM-OCR

在对表格区域的独立裁剪进行 OCR 时,数值单元中的小数分隔符(逗号)会丢失,而对整页进行 OCR 时则不会丢失。

作者: textlastig创建于 2026年8月28日更新于 2026年9月22日
### System Info / 系统信息 - Backend: MLX (mlx_vlm), model mlx-community/GLM-OCR-bf16 - Served via the SDK's own glmocr server (/glmocr/parse), not vLLM - Apple Silicon Mac, macOS - Deterministic decoding configured: temperature: 0.0, top_p: 0.00001, top_k: 1 (per config.yaml) ### Who can help? / 谁可以帮助到您? _No response_ ### Information / 问题信息 - [ ] The official example scripts / 官方的示例脚本 - [x] My own modified scripts and tasks / 我自己修改的脚本和任务 ### Reproduction / 复现过程 As a workaround for #240 (missing/garbled table footer rows during full-page OCR), we tried re-recognizing just the affected table region: cropping the page to the table's own detected bbox_2d (with modest padding), wrapping it as a single-page PDF, and submitting that alone to /glmocr/parse, e.g.: from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template model, processor = load("mlx-community/GLM-OCR-bf16") prompt = "Table Recognition:" formatted_prompt = apply_chat_template( processor, model.config, prompt, num_images=1) result = generate( model, processor, formatted_prompt, image=["./invoice_table_crop_only.png"], # same table, but as an isolated crop instead of the full page max_tokens=2048, verbose=True, ) Steps to reproduce the behavior: Run OCR on the full page containing the table from #TODO-issue1-number — numeric cells come back with a decimal comma (10,72, 2,300, etc.), as shown there. Crop the page down to just that table's own detected bbox_2d and run OCR again on the crop alone. Compare the two outputs — every numeric cell in the crop has lost its decimal separator. Full-page output for this table (from #TODO-issue1-number, line 1): 10,72, 13,41, 2,300, etc. — with commas. Isolated-crop output for the identical table:
DatumGOÄLeistungAnz.AuslagenFaktorHonorar
13.02.241Beratung(persönlich oder telefon.)123001072
6UntersuchungOrgansystemAuge/HNO123001341
1201subj.Refraktionsphär.-zylindr.Gl.123001193
1202objektiveRefraktionsbestimmung12300992
1207Prüfung./Bestimmung vonMehrstärken-o.Prismenbrille12300938
1242Binoc.Unters.d.Augenhintergrundes123002038
1256Applanationstonometrie118001049
SummeHonorarEUR:8623
RechnungsbetragEUR:8623
10,72 → 1072, 2,300 → 2300, and so on for every numeric cell, both in json_result and markdown_result. Note this run did recover the two footer rows from #240 (label and …

内容来源: zai-org/GLM-OCR