Instructions to use zai-org/GLM-OCR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zai-org/GLM-OCR with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("image-to-text", model="zai-org/GLM-OCR")# Load model directly from transformers import AutoTokenizer, AutoModelForImageTextToText tokenizer = AutoTokenizer.from_pretrained("zai-org/GLM-OCR") model = AutoModelForImageTextToText.from_pretrained("zai-org/GLM-OCR") - Inference
- Notebooks
- Google Colab
- Kaggle
| - dataset: | |
| id: allenai/olmOCR-bench | |
| task_id: overall | |
| value: 75.2 | |
| notes: "Excluding Headers & Footers category. Using ZAI API." | |
| source: | |
| url: https://huggingface.co/zai-org/GLM-OCR | |
| name: GLM-OCR API evaluation | |
| user: staghado | |
| - dataset: | |
| id: allenai/olmOCR-bench | |
| task_id: arxiv_math | |
| value: 80.7 | |
| source: | |
| url: https://huggingface.co/zai-org/GLM-OCR | |
| name: GLM-OCR API evaluation | |
| user: staghado | |
| - dataset: | |
| id: allenai/olmOCR-bench | |
| task_id: old_scans_math | |
| value: 68.3 | |
| source: | |
| url: https://huggingface.co/zai-org/GLM-OCR | |
| name: GLM-OCR API evaluation | |
| user: staghado | |
| - dataset: | |
| id: allenai/olmOCR-bench | |
| task_id: table_tests | |
| value: 77.6 | |
| source: | |
| url: https://huggingface.co/zai-org/GLM-OCR | |
| name: GLM-OCR API evaluation | |
| user: staghado | |
| - dataset: | |
| id: allenai/olmOCR-bench | |
| task_id: old_scans | |
| value: 37.6 | |
| source: | |
| url: https://huggingface.co/zai-org/GLM-OCR | |
| name: GLM-OCR API evaluation | |
| user: staghado | |
| - dataset: | |
| id: allenai/olmOCR-bench | |
| task_id: multi_column | |
| value: 76.7 | |
| source: | |
| url: https://huggingface.co/zai-org/GLM-OCR | |
| name: GLM-OCR API evaluation | |
| user: staghado | |
| - dataset: | |
| id: allenai/olmOCR-bench | |
| task_id: long_tiny_text | |
| value: 86.9 | |
| source: | |
| url: https://huggingface.co/zai-org/GLM-OCR | |
| name: GLM-OCR API evaluation | |
| user: staghado | |
| - dataset: | |
| id: allenai/olmOCR-bench | |
| task_id: headers_footers | |
| value: 95.8 | |
| source: | |
| url: https://huggingface.co/zai-org/GLM-OCR | |
| name: GLM-OCR API evaluation | |
| user: staghado | |
| - dataset: | |
| id: allenai/olmOCR-bench | |
| task_id: baseline | |
| value: 98.8 | |
| source: | |
| url: https://huggingface.co/zai-org/GLM-OCR | |
| name: GLM-OCR API evaluation | |
| user: staghado |