ciditel commited on
Commit
cee5ebe
·
verified ·
1 Parent(s): e48c8c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -1
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
- demo.launch(debug=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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()