Image-Text-to-Text
Transformers
Safetensors
English
qwen2_vl
latex
vLM
Vision
Codec
conversational
text-generation-inference
Instructions to use prithivMLmods/LatexMind-2B-Codec with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/LatexMind-2B-Codec with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="prithivMLmods/LatexMind-2B-Codec") 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)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("prithivMLmods/LatexMind-2B-Codec") model = AutoModelForImageTextToText.from_pretrained("prithivMLmods/LatexMind-2B-Codec") 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use prithivMLmods/LatexMind-2B-Codec with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/LatexMind-2B-Codec" # 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/LatexMind-2B-Codec", "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/LatexMind-2B-Codec
- SGLang
How to use prithivMLmods/LatexMind-2B-Codec 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/LatexMind-2B-Codec" \ --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/LatexMind-2B-Codec", "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/LatexMind-2B-Codec" \ --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/LatexMind-2B-Codec", "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/LatexMind-2B-Codec with Docker Model Runner:
docker model run hf.co/prithivMLmods/LatexMind-2B-Codec
Update README.md
Browse files
README.md
CHANGED
|
@@ -119,22 +119,22 @@ print(output_text)
|
|
| 119 |
|
| 120 |
**LatexMind-2B-Codec** is designed for tasks that require **image-based text recognition**, **math equation extraction**, and **multi-modal understanding**. It is particularly useful in the following scenarios:
|
| 121 |
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
|
| 130 |
# Limitations
|
| 131 |
|
| 132 |
Despite its capabilities, **LatexMind-2B-Codec** has some inherent limitations:
|
| 133 |
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
|
|
|
| 119 |
|
| 120 |
**LatexMind-2B-Codec** is designed for tasks that require **image-based text recognition**, **math equation extraction**, and **multi-modal understanding**. It is particularly useful in the following scenarios:
|
| 121 |
|
| 122 |
+
**Optical Character Recognition (OCR)** β Extracting printed and handwritten text from images, documents, and scanned pages.
|
| 123 |
+
**Math Expression Recognition** β Converting mathematical notations into structured **LaTeX format** for further computation and documentation.
|
| 124 |
+
**Image-to-Text Conversion** β Generating accurate descriptions for text-rich and math-heavy images.
|
| 125 |
+
**Document and Academic Processing** β Assisting researchers, students, and professionals in digitizing handwritten notes and extracting structured content from books, PDFs, and whiteboards.
|
| 126 |
+
**Automated Educational Support** β Enabling AI-powered tutors, content summarization, and interactive learning for subjects involving complex equations.
|
| 127 |
+
**Multi-Language OCR** β Recognizing text inside images across multiple languages, including English, Chinese, Japanese, Korean, Arabic, and various European languages.
|
| 128 |
+
**Video-Based Question Answering** β Understanding long-duration videos for content summarization, question answering, and structured data extraction.
|
| 129 |
|
| 130 |
# Limitations
|
| 131 |
|
| 132 |
Despite its capabilities, **LatexMind-2B-Codec** has some inherent limitations:
|
| 133 |
|
| 134 |
+
**Handwritten Text Accuracy** β While it can recognize handwritten equations, performance may degrade with highly unstructured or messy handwriting.
|
| 135 |
+
**Complex LaTeX Formatting** β The model may struggle with deeply nested or ambiguous LaTeX expressions, requiring manual corrections for precise formatting.
|
| 136 |
+
**Low-Resolution Images** β Extracting accurate text from blurry or low-resolution images can lead to misinterpretations or OCR errors.
|
| 137 |
+
**Contextual Understanding in Multi-Step Equations** β While it recognizes math expressions, solving multi-step problems autonomously may be limited.
|
| 138 |
+
**Limited Support for Rare Mathematical Notations** β Some specialized or domain-specific symbols may not be recognized with high accuracy.
|
| 139 |
+
**Processing Speed for Large Documents** β Performance may slow down when handling extremely large documents or dense mathematical content in real-time applications.
|
| 140 |
+
**Language-Specific OCR Variability** β While it supports multiple languages, OCR accuracy may vary depending on the script complexity and font style.
|