How to use lightonai/LightOnOCR-1B-1025 with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("image-to-text", model="lightonai/LightOnOCR-1B-1025")
# Load model directly from transformers import AutoProcessor, AutoModelForSeq2SeqLM processor = AutoProcessor.from_pretrained("lightonai/LightOnOCR-1B-1025") model = AutoModelForSeq2SeqLM.from_pretrained("lightonai/LightOnOCR-1B-1025")
1cfad1e 816ab0f 1cfad1e 816ab0f
1
2
3
4
5
6
7
8
9
{ "image_break_token": "<|vision_pad|>", "image_end_token": "<|vision_end|>", "image_token": "<|image_pad|>", "patch_size": 14, "processor_class": "LightOnOCRProcessor", "spatial_merge_size": 2 }