Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -217,7 +217,7 @@ async def process_gpt4o_ocr(image, output_file):
|
|
| 217 |
messages = [{
|
| 218 |
"role": "user",
|
| 219 |
"content": [
|
| 220 |
-
{"type": "text", "text": "Extract
|
| 221 |
{"type": "image_url", "image_url": {"url": f"data:image/png;base64,{img_str}", "detail": "auto"}}
|
| 222 |
]
|
| 223 |
}]
|
|
@@ -448,7 +448,9 @@ with tab_ocr:
|
|
| 448 |
if st.button("Run OCR 🚀", key="ocr_run"):
|
| 449 |
output_file = generate_filename("ocr_output", "md")
|
| 450 |
st.session_state['processing']['ocr'] = True
|
|
|
|
| 451 |
result = asyncio.run(process_gpt4o_ocr(image, output_file))
|
|
|
|
| 452 |
entry = f"OCR Test: {selected_file} -> {output_file}"
|
| 453 |
st.session_state['history'].append(entry)
|
| 454 |
#st.text_area("OCR Result", result, height=200, key="ocr_result")
|
|
|
|
| 217 |
messages = [{
|
| 218 |
"role": "user",
|
| 219 |
"content": [
|
| 220 |
+
{"type": "text", "text": "Extract electronic text, and explain"},
|
| 221 |
{"type": "image_url", "image_url": {"url": f"data:image/png;base64,{img_str}", "detail": "auto"}}
|
| 222 |
]
|
| 223 |
}]
|
|
|
|
| 448 |
if st.button("Run OCR 🚀", key="ocr_run"):
|
| 449 |
output_file = generate_filename("ocr_output", "md")
|
| 450 |
st.session_state['processing']['ocr'] = True
|
| 451 |
+
|
| 452 |
result = asyncio.run(process_gpt4o_ocr(image, output_file))
|
| 453 |
+
|
| 454 |
entry = f"OCR Test: {selected_file} -> {output_file}"
|
| 455 |
st.session_state['history'].append(entry)
|
| 456 |
#st.text_area("OCR Result", result, height=200, key="ocr_result")
|