Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -87,10 +87,10 @@ def ocr_image_gradio_stream(image, max_tokens=4096):
|
|
| 87 |
for new_text in streamer:
|
| 88 |
generated_text += new_text
|
| 89 |
processed_text = process_tags(generated_text)
|
| 90 |
-
yield processed_text, gr.update(interactive=False)
|
| 91 |
|
| 92 |
# Re-enable button when complete
|
| 93 |
-
yield processed_text, gr.update(interactive=True)
|
| 94 |
|
| 95 |
except Exception as e:
|
| 96 |
error_msg = f"Error processing image: {str(e)}"
|
|
@@ -196,12 +196,12 @@ with gr.Blocks(title="Nanonets OCR Demo") as demo:
|
|
| 196 |
show_progress=True
|
| 197 |
)
|
| 198 |
|
| 199 |
-
image_input.change(
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
)
|
| 205 |
|
| 206 |
# Add model information section
|
| 207 |
with gr.Accordion("About Nanonets-OCR-s", open=False):
|
|
|
|
| 87 |
for new_text in streamer:
|
| 88 |
generated_text += new_text
|
| 89 |
processed_text = process_tags(generated_text)
|
| 90 |
+
yield process_tags(processed_text), gr.update(interactive=False)
|
| 91 |
|
| 92 |
# Re-enable button when complete
|
| 93 |
+
yield process_tags(processed_text), gr.update(interactive=True)
|
| 94 |
|
| 95 |
except Exception as e:
|
| 96 |
error_msg = f"Error processing image: {str(e)}"
|
|
|
|
| 196 |
show_progress=True
|
| 197 |
)
|
| 198 |
|
| 199 |
+
# image_input.change(
|
| 200 |
+
# fn=ocr_image_gradio_stream,
|
| 201 |
+
# inputs=[image_input, max_tokens_slider],
|
| 202 |
+
# outputs=[output_text, extract_btn],
|
| 203 |
+
# show_progress=True
|
| 204 |
+
# )
|
| 205 |
|
| 206 |
# Add model information section
|
| 207 |
with gr.Accordion("About Nanonets-OCR-s", open=False):
|