Transformers
OCR
Apple Silicon
MLX
MLX-VLM
Vision Language Model
Document Processing
Gradio
Apple M1
Apple M2
Apple M3
Apple M4
MonkeyOCR
Qwen2.5-VL
Run this model with HF Jobs
Run Jimmi42/MonkeyOCR-Apple-Silicon on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Jimmi42/MonkeyOCR-Apple-Silicon. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Jimmi42/MonkeyOCR-Apple-Silicon on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use Jimmi42/MonkeyOCR-Apple-Silicon with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Jimmi42/MonkeyOCR-Apple-Silicon with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Jimmi42/MonkeyOCR-Apple-Silicon", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 1,532 Bytes
18352e1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | #!/usr/bin/env python3
"""
Patch for PyTorch 2.7 weights_only issue with doclayout_yolo models
This allows loading the YOLO model weights safely
"""
import torch
import torch.serialization
# Store original torch.load
_original_torch_load = torch.load
def patched_torch_load(*args, **kwargs):
"""Patched torch.load that defaults to weights_only=False for compatibility"""
# If weights_only is not specified, set it to False for compatibility
if 'weights_only' not in kwargs:
kwargs['weights_only'] = False
return _original_torch_load(*args, **kwargs)
def patch_torch_load():
"""Patch torch.load to allow doclayout_yolo classes"""
try:
# First try to add safe globals
torch.serialization.add_safe_globals([
'doclayout_yolo.nn.tasks.YOLOv10DetectionModel',
'doclayout_yolo.nn.modules.YOLOv10DetectionModel',
'ultralytics.nn.tasks.DetectionModel',
'ultralytics.nn.modules.Conv',
'ultralytics.nn.modules.C2f',
'ultralytics.nn.modules.SPPF',
'ultralytics.nn.modules.Detect',
'ultralytics.nn.modules.DFL',
])
print("✅ PyTorch safe globals added for doclayout_yolo")
except Exception as e:
print(f"⚠️ Safe globals failed: {e}")
# Also monkey-patch torch.load to default to weights_only=False
torch.load = patched_torch_load
print("✅ PyTorch load function patched for compatibility")
if __name__ == "__main__":
patch_torch_load() |