nielsr HF staff commited on
Commit
441d897
1 Parent(s): 7406a0d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -15
app.py CHANGED
@@ -42,23 +42,13 @@ def process_document(image, question):
42
 
43
  demo = gr.Interface(
44
  fn=process_document,
45
- inputs= gr.inputs.Image(type="pil"),
46
  outputs="json",
47
  title=f"Demo: Donut 🍩 for DocVQA",
48
  description = "Gradio Demo for Donut, an instance of `VisionEncoderDecoderModel` fine-tuned on DocVQA (document visual question answering). To use it, simply upload your image and type a question and click 'submit', or click one of the examples to load them. Read more at the links below."
49
- article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2111.15664' target='_blank'>Donut: OCR-free Document Understanding Transformer</a> | <a href='https://github.com/clovaai/donut' target='_blank'>Github Repo</a></p>"
 
 
 
50
 
51
- interface = gr.Interface(fn=answer_question,
52
- inputs=["image", "text"],
53
- outputs="json",
54
- examples=examples,
55
- title=title,
56
- description=description,
57
- article=article,
58
- enable_queue=True)
59
- interface.launch(debug=True)
60
-
61
- examples=[["example_1.png", "When is the coffee break?"]],
62
- cache_examples=False,
63
- )
64
  demo.launch()
 
42
 
43
  demo = gr.Interface(
44
  fn=process_document,
45
+ inputs=["image", "text"],
46
  outputs="json",
47
  title=f"Demo: Donut 🍩 for DocVQA",
48
  description = "Gradio Demo for Donut, an instance of `VisionEncoderDecoderModel` fine-tuned on DocVQA (document visual question answering). To use it, simply upload your image and type a question and click 'submit', or click one of the examples to load them. Read more at the links below."
49
+ article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2111.15664' target='_blank'>Donut: OCR-free Document Understanding Transformer</a> | <a href='https://github.com/clovaai/donut' target='_blank'>Github Repo</a></p>",
50
+ enable_queue=True,
51
+ examples=[["example_1.png", "When is the coffee break?"]],
52
+ cache_examples=False)
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  demo.launch()