Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -226,4 +226,20 @@ with gr.Blocks(css=css) as demo:
|
|
| 226 |
|
| 227 |
submit_btn.click(process_image, [input_img, task_prompt, text_input, model_selector], [output_text])
|
| 228 |
|
| 229 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 226 |
|
| 227 |
submit_btn.click(process_image, [input_img, task_prompt, text_input, model_selector], [output_text])
|
| 228 |
|
| 229 |
+
gradio_app_bill= gr.Interface(
|
| 230 |
+
fn=run_example,
|
| 231 |
+
inputs=[
|
| 232 |
+
gr.Image(type='filepath'),
|
| 233 |
+
gr.Dropdown(choices=list(models.keys()), label="Model", value='microsoft/Florence-2-large'),
|
| 234 |
+
gr.Dropdown(choices=[
|
| 235 |
+
'Caption', 'Detailed Caption', 'More Detailed Caption',
|
| 236 |
+
'OCR', 'OCR with Region'
|
| 237 |
+
], label="Task Prompt", value= 'More Detailed Caption'),
|
| 238 |
+
text_input = gr.Textbox(label="Text Input (optional)")
|
| 239 |
+
],
|
| 240 |
+
outputs="text",
|
| 241 |
+
)
|
| 242 |
+
demo = gr.TabbedInterface([gradio_app_bill], ["bill2text"])
|
| 243 |
+
|
| 244 |
+
if __name__ == "__main__":
|
| 245 |
+
demo.launch()
|