Instructions to use Remidesbois/surya-bubble-ocr-poneglyph with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Remidesbois/surya-bubble-ocr-poneglyph with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Remidesbois/surya-bubble-ocr-poneglyph") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Remidesbois/surya-bubble-ocr-poneglyph") model = AutoModelForMultimodalLM.from_pretrained("Remidesbois/surya-bubble-ocr-poneglyph", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Remidesbois/surya-bubble-ocr-poneglyph with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Remidesbois/surya-bubble-ocr-poneglyph" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Remidesbois/surya-bubble-ocr-poneglyph", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/Remidesbois/surya-bubble-ocr-poneglyph
- SGLang
How to use Remidesbois/surya-bubble-ocr-poneglyph with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Remidesbois/surya-bubble-ocr-poneglyph" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Remidesbois/surya-bubble-ocr-poneglyph", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Remidesbois/surya-bubble-ocr-poneglyph" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Remidesbois/surya-bubble-ocr-poneglyph", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use Remidesbois/surya-bubble-ocr-poneglyph with Docker Model Runner:
docker model run hf.co/Remidesbois/surya-bubble-ocr-poneglyph
Surya OCR — Poneglyph, crops de bulles
Fine-tuning local sur RTX 5090. Entrée : un crop RGB de bulle ; sortie : sa transcription française.
Prompt : Transcris exactement le texte visible dans cette bulle. Ne rajoute rien.
Meilleur checkpoint sélectionné uniquement sur le CER de validation :
checkpoint-705.
Test réservé
| Métrique | Valeur |
|---|---|
| Bulles | 1612 |
| CER | 0.471 % |
| WER | 1.843 % |
| Exact match | 91.32 % |
| Distance de Levenshtein moyenne | 0.1520 |
| Sorties vides | 0.00 % |
| Générations à la limite de tokens | 0 |
Split strict par page. Les crops et les prédictions individuelles restent privés. Les métriques utilisent une normalisation des espaces et retirent une paire de guillemets extérieurs. Les scores ci-dessus concernent les poids BF16 évalués en Python. Pas de comparaison avec un autre modèle.
Chargement
Poids BF16 au format Transformers standard (transformers==5.14.1).
Charger AutoProcessor et AutoModelForImageTextToText depuis ce dossier.
Les patches Liger d'entraînement ne sont pas nécessaires au rechargement.
generation_config.json contient les identifiants EOS/PAD et le budget de génération.
Empreinte SHA-256 des poids : 67fa1733d2541d6305cffef1e5202e47930a5f5393d1901adda52e7daab05629.
ONNX / WebGPU
Une version navigateur validée est disponible dans onnx/. Elle contient un encodeur visuel, un graphe de préremplissage et un décodeur récurrent, en précision mixte FP16/FP32. Voir les instructions et contrôles. Le dépôt Poneglyph propose la page /sandbox/surya et le moteur Surya · WebGPU.
- Downloads last month
- 61
Model tree for Remidesbois/surya-bubble-ocr-poneglyph
Base model
datalab-to/surya-ocr-2