Update app.py
Browse files
app.py
CHANGED
@@ -53,7 +53,7 @@ def ocr_on_image(image):
|
|
53 |
"Extract only the raw text with and do not add any comment"
|
54 |
"Extract the content ligne by ligne"
|
55 |
)
|
56 |
-
messages = [{"role": "user", "content": [{"type": "text", "text":
|
57 |
texts = processor.apply_chat_template(messages, add_generation_prompt=True)
|
58 |
inputs = processor(text=texts, images=[image], return_tensors="pt").to(device)
|
59 |
outputs = model.generate(**inputs, max_new_tokens=250)
|
|
|
53 |
"Extract only the raw text with and do not add any comment"
|
54 |
"Extract the content ligne by ligne"
|
55 |
)
|
56 |
+
messages = [{"role": "user", "content": [{"type": "text", "text": "Extract handwritten text from the image and output only the extracted text without any additional description or commentary in output"}, {"type": "image"}]}]
|
57 |
texts = processor.apply_chat_template(messages, add_generation_prompt=True)
|
58 |
inputs = processor(text=texts, images=[image], return_tensors="pt").to(device)
|
59 |
outputs = model.generate(**inputs, max_new_tokens=250)
|