表脚注/摘要行从 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 / 复现过程
We call the model directly the same way as in #96:
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.png"],
max_tokens=2048,
verbose=True,
)
### Expected behavior / 期待表现
1. Take the attached source image (billing table from a real invoice, anonymized — no name/diagnosis, two rows highlighted in red are the ones missing from the output).
2. Run the code above (or the equivalent /glmocr/parse SDK call) on it.
3. Compare the returned table HTML against the source image — the last two rows ("Summe Honorar EUR: 86,23" and "Rechnungsbetrag EUR: 86,23") are not correctly transcribed.
4. Repeat the same call on the identical input a few times — the failure mode is not consistent (see below).
Actual Table Recognition: output for this region:
The 7 line-item rows are recognized correctly. The last two rows are not: instead of the label and amount text visible in the source, the table ends with two near-empty rows containing only a stray 1 and 2,300 copied from the pattern
…
| Datum | GOÄ | Leistung | Anz. | Auslagen | Faktor | Honorar |
|---|---|---|---|---|---|---|
| 13.02.24 | 1 | Beratung (persönlich oder telefon.) | 1 | 2,300 | 10,72 | |
| 6 | Untersuchung Organsystem Auge/HNO | 1 | 2,300 | 13,41 | ||
| 1201 | subj.Refraktion sphär.-zylindr.Gl. | 1 | 2,300 | 11,93 | ||
| 1202 | objektive Refraktionsbestimmung | 1 | 2,300 | 11,93 | ||
| 1207 | Prüfung./ Bestimmung von Mehrstärken-o. Prismenbrille | 1 | 2,300 | 9,92 | ||
| 1242 | Binoc.Unters.d.Augenhintergrundes | 1 | 2,300 | 9,38 | ||
| 1256 | Applanationstonometrie | 1 | 2,300 | 10,49 | ||
| 1 | 2,300 | |||||
| 1 | 2,300 |
内容来源: zai-org/GLM-OCR