Image-Text-to-Text
Transformers
Safetensors
English
qwen2_vl
feature-extraction
Generation
OCR
KIE
Highlights-Generator
conversational
text-generation-inference
Instructions to use prithivMLmods/WASP-2B-VL-Highlights with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/WASP-2B-VL-Highlights with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="prithivMLmods/WASP-2B-VL-Highlights") 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, AutoModel processor = AutoProcessor.from_pretrained("prithivMLmods/WASP-2B-VL-Highlights") model = AutoModel.from_pretrained("prithivMLmods/WASP-2B-VL-Highlights") 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
- vLLM
How to use prithivMLmods/WASP-2B-VL-Highlights with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/WASP-2B-VL-Highlights" # 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/WASP-2B-VL-Highlights", "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/WASP-2B-VL-Highlights
- SGLang
How to use prithivMLmods/WASP-2B-VL-Highlights 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/WASP-2B-VL-Highlights" \ --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/WASP-2B-VL-Highlights", "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/WASP-2B-VL-Highlights" \ --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/WASP-2B-VL-Highlights", "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/WASP-2B-VL-Highlights with Docker Model Runner:
docker model run hf.co/prithivMLmods/WASP-2B-VL-Highlights
Update README.md
#2
by prithivMLmods - opened
README.md
CHANGED
|
@@ -7,39 +7,39 @@ base_model:
|
|
| 7 |
pipeline_tag: image-text-to-text
|
| 8 |
library_name: transformers
|
| 9 |
tags:
|
| 10 |
-
- Highlights
|
| 11 |
- Generation
|
| 12 |
- OCR
|
| 13 |
- KIE
|
|
|
|
| 14 |
---
|
| 15 |
|
| 16 |
-

|
|
|
|
|
|
|
| 17 |
|
| 18 |
+
# **WASP-2B-VL-Highlights**
|
|
|
|
| 19 |
|
| 20 |
+
> \[!Note]
|
| 21 |
+
> The **WASP-2B-VL-Highlights** model is a fine-tuned version of *Qwen2-VL-2B-Instruct*, specifically optimized for **image highlights extraction**, **messy handwriting recognition**, **Optical Character Recognition (OCR)**, **English language understanding**, and **math problem solving with LaTeX formatting**. This model uses a conversational visual-language interface to effectively handle multi-modal tasks.
|
| 22 |
+
|
| 23 |
+
[](https://colab.research.google.com/#fileId=https%3A//huggingface.co/prithivMLmods/WASP-2B-VL-Highlights/blob/main/Callisto_OCR3_2B_Instruct.ipynb)
|
| 24 |
|
| 25 |
# **Key Enhancements:**
|
| 26 |
|
| 27 |
+
* **State-of-the-art image comprehension** across varying resolutions and aspect ratios:
|
| 28 |
+
WASP-2B-VL-Highlights delivers top-tier performance on benchmarks such as MathVista, DocVQA, RealWorldQA, and MTVQA.
|
| 29 |
|
| 30 |
+
* **Image Highlighting Expertise**:
|
| 31 |
Specially tuned to **identify and summarize key visual elements** in an image — ideal for **creating visual highlights**, annotations, and summaries.
|
| 32 |
|
| 33 |
+
* **Handwriting OCR Enhanced**:
|
| 34 |
Recognizes **messy and complex handwritten notes** with precision, perfect for digitizing real-world documents.
|
| 35 |
|
| 36 |
+
* **Video Content Understanding**:
|
| 37 |
+
Capable of processing videos longer than 20 minutes for **context-aware Q\&A, transcription**, and **highlight extraction**.
|
| 38 |
|
| 39 |
+
* **Multi-device Integration**:
|
| 40 |
Can be used as an intelligent agent for mobile phones, robots, and other devices — able to **understand visual scenes and execute actions**.
|
| 41 |
|
| 42 |
+
* **Multilingual OCR Support**:
|
| 43 |
In addition to English and Chinese, supports OCR for European languages, Japanese, Korean, Arabic, and Vietnamese.
|
| 44 |
|
| 45 |
# **Run with Transformers🤗**
|
|
|
|
| 76 |
|
| 77 |
# Define model options
|
| 78 |
MODEL_OPTIONS = {
|
| 79 |
+
"Needle-2B-VL-Highlights": "prithivMLmods/WASP-2B-VL-Highlights",
|
| 80 |
}
|
| 81 |
|
| 82 |
# Preload models and processors into CUDA
|
|
|
|
| 288 |
model_choice = gr.Dropdown(
|
| 289 |
label="Model Selection",
|
| 290 |
choices=list(MODEL_OPTIONS.keys()),
|
| 291 |
+
value="WASP-2B-VL-Highlights"
|
| 292 |
)
|
| 293 |
input_media = gr.File(
|
| 294 |
label="Upload Image", type="filepath"
|