Instructions to use EZCon/GLM-OCR-4bit-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use EZCon/GLM-OCR-4bit-mlx with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("EZCon/GLM-OCR-4bit-mlx") config = load_config("EZCon/GLM-OCR-4bit-mlx") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- LM Studio
- Pi new
How to use EZCon/GLM-OCR-4bit-mlx with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "EZCon/GLM-OCR-4bit-mlx"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "EZCon/GLM-OCR-4bit-mlx" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use EZCon/GLM-OCR-4bit-mlx with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "EZCon/GLM-OCR-4bit-mlx"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default EZCon/GLM-OCR-4bit-mlx
Run Hermes
hermes
Upload folder using huggingface_hub
Browse files- README.md +6 -4
- processor_config.json +1 -2
README.md
CHANGED
|
@@ -10,16 +10,18 @@ language:
|
|
| 10 |
- ja
|
| 11 |
- ko
|
| 12 |
pipeline_tag: image-to-text
|
| 13 |
-
library_name:
|
| 14 |
-
base_model:
|
| 15 |
-
- zai-org/GLM-OCR
|
| 16 |
tags:
|
| 17 |
- mlx
|
| 18 |
---
|
| 19 |
|
| 20 |
# EZCon/GLM-OCR-4bit-mlx
|
| 21 |
-
|
|
|
|
|
|
|
| 22 |
Refer to the [original model card](https://huggingface.co/unsloth/GLM-OCR) for more details on the model.
|
|
|
|
| 23 |
## Use with mlx
|
| 24 |
|
| 25 |
```bash
|
|
|
|
| 10 |
- ja
|
| 11 |
- ko
|
| 12 |
pipeline_tag: image-to-text
|
| 13 |
+
library_name: mlx
|
| 14 |
+
base_model: unsloth/GLM-OCR
|
|
|
|
| 15 |
tags:
|
| 16 |
- mlx
|
| 17 |
---
|
| 18 |
|
| 19 |
# EZCon/GLM-OCR-4bit-mlx
|
| 20 |
+
|
| 21 |
+
This model was converted to MLX format from [`unsloth/GLM-OCR`](https://huggingface.co/unsloth/GLM-OCR)
|
| 22 |
+
using mlx-vlm version **0.4.2**.
|
| 23 |
Refer to the [original model card](https://huggingface.co/unsloth/GLM-OCR) for more details on the model.
|
| 24 |
+
|
| 25 |
## Use with mlx
|
| 26 |
|
| 27 |
```bash
|
processor_config.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
{
|
| 2 |
"image_processor": {
|
| 3 |
-
"data_format": "channels_first",
|
| 4 |
"do_convert_rgb": true,
|
| 5 |
"do_normalize": true,
|
| 6 |
"do_rescale": true,
|
|
@@ -10,7 +9,7 @@
|
|
| 10 |
0.4578275,
|
| 11 |
0.40821073
|
| 12 |
],
|
| 13 |
-
"image_processor_type": "
|
| 14 |
"image_std": [
|
| 15 |
0.26862954,
|
| 16 |
0.26130258,
|
|
|
|
| 1 |
{
|
| 2 |
"image_processor": {
|
|
|
|
| 3 |
"do_convert_rgb": true,
|
| 4 |
"do_normalize": true,
|
| 5 |
"do_rescale": true,
|
|
|
|
| 9 |
0.4578275,
|
| 10 |
0.40821073
|
| 11 |
],
|
| 12 |
+
"image_processor_type": "Glm46VImageProcessor",
|
| 13 |
"image_std": [
|
| 14 |
0.26862954,
|
| 15 |
0.26130258,
|