Update app.py
Browse files
app.py
CHANGED
|
@@ -72,7 +72,7 @@ def process_image(image):
|
|
| 72 |
try:
|
| 73 |
pixel_values = load_image(image, max_num=12).to(torch.bfloat16).cuda()
|
| 74 |
generation_config = dict(max_new_tokens=1024, do_sample=True)
|
| 75 |
-
question = '<image>\
|
| 76 |
response = model.chat(tokenizer, pixel_values, question, generation_config)
|
| 77 |
return response
|
| 78 |
except Exception as e:
|
|
|
|
| 72 |
try:
|
| 73 |
pixel_values = load_image(image, max_num=12).to(torch.bfloat16).cuda()
|
| 74 |
generation_config = dict(max_new_tokens=1024, do_sample=True)
|
| 75 |
+
question = '<image>\nExtract text from the image, respond with only the extracted text.'
|
| 76 |
response = model.chat(tokenizer, pixel_values, question, generation_config)
|
| 77 |
return response
|
| 78 |
except Exception as e:
|