Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -190,11 +190,14 @@ def create_gradio_interface():
|
|
| 190 |
# Left Column (Inputs)
|
| 191 |
with gr.Column(scale=1):
|
| 192 |
model_choice = gr.Dropdown(
|
| 193 |
-
choices=["Camel-Doc-OCR-062825",
|
|
|
|
|
|
|
|
|
|
| 194 |
label="Select Model", value="Camel-Doc-OCR-062825"
|
| 195 |
)
|
| 196 |
task_choice = gr.Dropdown(
|
| 197 |
-
choices=["Content Extraction", "Layout Analysis"],
|
| 198 |
label="Select Task", value="Content Extraction"
|
| 199 |
)
|
| 200 |
image_input = gr.Image(label="Upload Image", type="pil", sources=['upload'])
|
|
@@ -223,12 +226,20 @@ def create_gradio_interface():
|
|
| 223 |
|
| 224 |
process_btn.click(
|
| 225 |
fn=process_document_stream,
|
| 226 |
-
inputs=[model_choice,
|
| 227 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 228 |
)
|
| 229 |
clear_btn.click(
|
| 230 |
clear_all_outputs,
|
| 231 |
-
outputs=[image_input,
|
|
|
|
|
|
|
|
|
|
| 232 |
)
|
| 233 |
return demo
|
| 234 |
|
|
|
|
| 190 |
# Left Column (Inputs)
|
| 191 |
with gr.Column(scale=1):
|
| 192 |
model_choice = gr.Dropdown(
|
| 193 |
+
choices=["Camel-Doc-OCR-062825",
|
| 194 |
+
"MonkeyOCR-Recognition",
|
| 195 |
+
"Nanonets-OCR-s",
|
| 196 |
+
"Megalodon-OCR-Sync-0713"],
|
| 197 |
label="Select Model", value="Camel-Doc-OCR-062825"
|
| 198 |
)
|
| 199 |
task_choice = gr.Dropdown(
|
| 200 |
+
choices=["Content Extraction", "Layout Analysis(.json)"],
|
| 201 |
label="Select Task", value="Content Extraction"
|
| 202 |
)
|
| 203 |
image_input = gr.Image(label="Upload Image", type="pil", sources=['upload'])
|
|
|
|
| 226 |
|
| 227 |
process_btn.click(
|
| 228 |
fn=process_document_stream,
|
| 229 |
+
inputs=[model_choice,
|
| 230 |
+
task_choice,
|
| 231 |
+
image_input,
|
| 232 |
+
max_new_tokens],
|
| 233 |
+
outputs=[raw_output_stream,
|
| 234 |
+
markdown_output,
|
| 235 |
+
json_output]
|
| 236 |
)
|
| 237 |
clear_btn.click(
|
| 238 |
clear_all_outputs,
|
| 239 |
+
outputs=[image_input,
|
| 240 |
+
raw_output_stream,
|
| 241 |
+
markdown_output,
|
| 242 |
+
json_output]
|
| 243 |
)
|
| 244 |
return demo
|
| 245 |
|