om440 commited on
Commit
db78f91
·
verified ·
1 Parent(s): b1538d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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": prompt3}, {"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)
 
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)