Instructions to use mlx-community/GLM-OCR-bf16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mlx-community/GLM-OCR-bf16 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="mlx-community/GLM-OCR-bf16")# Load model directly from transformers import AutoTokenizer, AutoModelForImageTextToText tokenizer = AutoTokenizer.from_pretrained("mlx-community/GLM-OCR-bf16") model = AutoModelForImageTextToText.from_pretrained("mlx-community/GLM-OCR-bf16") - MLX
How to use mlx-community/GLM-OCR-bf16 with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir GLM-OCR-bf16 mlx-community/GLM-OCR-bf16
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- LM Studio
add base model so model shows in model tree
#1
by davanstrien HF Staff - opened
README.md
CHANGED
|
@@ -13,6 +13,8 @@ pipeline_tag: image-to-text
|
|
| 13 |
library_name: transformers
|
| 14 |
tags:
|
| 15 |
- mlx
|
|
|
|
|
|
|
| 16 |
---
|
| 17 |
|
| 18 |
# mlx-community/GLM-OCR-bf16
|
|
@@ -26,4 +28,4 @@ pip install -U mlx-vlm
|
|
| 26 |
|
| 27 |
```bash
|
| 28 |
python -m mlx_vlm.generate --model mlx-community/GLM-OCR-bf16 --max-tokens 100 --temperature 0.0 --prompt "Describe this image." --image <path_to_image>
|
| 29 |
-
```
|
|
|
|
| 13 |
library_name: transformers
|
| 14 |
tags:
|
| 15 |
- mlx
|
| 16 |
+
base_model:
|
| 17 |
+
- zai-org/GLM-OCR
|
| 18 |
---
|
| 19 |
|
| 20 |
# mlx-community/GLM-OCR-bf16
|
|
|
|
| 28 |
|
| 29 |
```bash
|
| 30 |
python -m mlx_vlm.generate --model mlx-community/GLM-OCR-bf16 --max-tokens 100 --temperature 0.0 --prompt "Describe this image." --image <path_to_image>
|
| 31 |
+
```
|