Image-Text-to-Text
Transformers
Safetensors
English
Chinese
qwen2_5_vl
text-generation-inference
image-captioning
optical-character-recognition
intelligent-character-recognition
caption
ocr
visual-understanding
art
image-to-text
vlm
table
conversational
Instructions to use prithivMLmods/Megalodon-OCR-Sync-0713 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/Megalodon-OCR-Sync-0713 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="prithivMLmods/Megalodon-OCR-Sync-0713") 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("prithivMLmods/Megalodon-OCR-Sync-0713") model = AutoModelForMultimodalLM.from_pretrained("prithivMLmods/Megalodon-OCR-Sync-0713", 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 prithivMLmods/Megalodon-OCR-Sync-0713 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/Megalodon-OCR-Sync-0713" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/Megalodon-OCR-Sync-0713", "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/prithivMLmods/Megalodon-OCR-Sync-0713
- SGLang
How to use prithivMLmods/Megalodon-OCR-Sync-0713 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 "prithivMLmods/Megalodon-OCR-Sync-0713" \ --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": "prithivMLmods/Megalodon-OCR-Sync-0713", "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 "prithivMLmods/Megalodon-OCR-Sync-0713" \ --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": "prithivMLmods/Megalodon-OCR-Sync-0713", "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 prithivMLmods/Megalodon-OCR-Sync-0713 with Docker Model Runner:
docker model run hf.co/prithivMLmods/Megalodon-OCR-Sync-0713
Commit History
-
update meta-data (#3)
Verified signature- update meta-data (d83292e3e2a1f2007a0a70a319586d0b0749bc57)314648f
-
Update README.md
Verified signaturefd251d0 -
Update README.md
Verified signaturebbfba51 -
Update README.md
Verified signaturee8fe6ae
-
Update README.md
Verified signatureb94abab
-
delete md
Verified signaturead37627 -
Upload Finetune_SigLIP2-Image-Classification-README.md
Verified signature8f4e668 -
Update README.md
Verified signature5a16cae -
Update README.md
Verified signature3b3caf9
-
Update README.md
Verified signaturec4d249f -
Undo Metadata
Verified signature8f10183
-
Update License
Verified signature57b55dc -
Update Metadata (#1)
Verified signature- Update Metadata (9d4e402e9d5e6683c69f17a5e2f71366d2949b06)9d8a867 -
QWEN LICENSE (#2)
Verified signature- QWEN LICENSE (ea232f83f9979496ea9c7ac0ea3c9c1de1c0b207)4201f45 -
Colab Notebook (T4 GPU)
Verified signature0c7bc2c -
Delete .ipynb_checkpoints
Verified signature3ce5b82 -
Upload folder using huggingface_hub
Verified signature3bec667 -
Update README.md
Verified signaturef25b3bb -
Update README.md
Verified signatureda4bfce -
Update README.md
Verified signature15d6c13 -
Create README.md
Verified signature39acc00 -
initial commit
Verified signature278685d