to-be commited on
Commit
e45a37b
1 Parent(s): f25b610

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -10
app.py CHANGED
@@ -66,15 +66,16 @@ article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2111.156
66
 
67
  gr_image = gr.Image().style( height=800)
68
 
69
- demo = gr.Interface(
70
- fn=process_document,
71
- inputs=gr_image,
72
- outputs="json",
73
- title="Demo: Donut 🍩 for invoice header retrieval",
74
- description=description,
75
- article=article,
76
- enable_queue=True,
77
- examples=[["example.jpg"], ["example_2.jpg"], ["example_3.jpg"]],
78
- cache_examples=False)
 
79
 
80
  demo.launch()
 
66
 
67
  gr_image = gr.Image().style( height=800)
68
 
69
+ #demo = gr.Interface(fn=process_document,inputs=gr_image,outputs="json",title="Demo: Donut 🍩 for invoice header retrieval", description=description,
70
+ # article=article,enable_queue=True, examples=[["example.jpg"], ["example_2.jpg"], ["example_3.jpg"]], cache_examples=False)
71
+
72
+ with gr.Blocks() as demo:
73
+ gr.Markdown(description)
74
+ with gr.Row():
75
+ inp = gr.Image().style(height=800)
76
+ out = gr.JSON()
77
+ btn = gr.Button("Run")
78
+ gr.Examples(["example.jpg"], ["example_2.jpg"], ["example_3.jpg"], inputs=[inp])
79
+ btn.click(fn=process_document, inputs=inp, outputs=out)
80
 
81
  demo.launch()