Quick start
from transformers import pipeline,TextStreamer
tokenizer=AutoTokenizer.from_pretrained("Adnan2942/Qwen2-VL-7B-Instruct-LoRA-Latex-OCR")
text_streamer=TextStreamer(tokenizer,skip_prompt=True,skip_special_tokens=True)
input="your-image-input-object" ###example:"<PIL.PngImagePlugin.PngImageFile image mode=RGB size=160x40>"
generator = pipeline("image-text-to-text", model="Adnan2942/Qwen2-VL-7B-Instruct-LoRA-Latex-OCR", device="cuda")
output = generator([{"role": "user", "content": [
{"type":"text","text":"Write the Latex representation for this image"},
{"type":"image","image":input}]}], max_new_tokens=128,streamer=text_streamer,use_cache=True,temperature=1,min_p=0.1)
Uploaded finetuned model
- Developed by: Adnan2942
- License: apache-2.0
- Finetuned from model : unsloth/qwen2-vl-7b-instruct-unsloth-bnb-4bit
- Adapter Weights repo : https://huggingface.co/Adnan2942/Qwen2-VL-7B-Instruct-LoRA-Latex-OCR-Adapter (see this for training logs as well)
This qwen2_vl model was trained 2x faster with Unsloth and Huggingface's TRL library.