EliottZemour commited on
Commit
f1ded69
1 Parent(s): 4c1af0e

update app

Browse files
Files changed (1) hide show
  1. app.py +30 -5
app.py CHANGED
@@ -84,9 +84,7 @@ table.gr-samples-table tr td {
84
  table.gr-samples-table tr td:first-of-type {
85
  width: 0%;
86
  }
87
- div#short-upload-box div.absolute {
88
- display: none !important;
89
- }
90
  gradio-app > div > div > div > div.w-full > div, .gradio-app > div > div > div > div.w-full > div {
91
  gap: 0px 2%;
92
  }
@@ -125,6 +123,14 @@ def create_html_card(arxiv_link):
125
 
126
  demo = gr.Blocks(css=CSS)
127
  with demo:
 
 
 
 
 
 
 
 
128
  with gr.Row(equal_height=True):
129
  with gr.Column():
130
  with gr.Row():
@@ -135,7 +141,8 @@ with demo:
135
  max_lines=1,
136
  elem_id="url-textbox",
137
  )
138
- button = gr.Button("Get", variant="primary")
 
139
  with gr.Row():
140
  card = gr.HTML()
141
 
@@ -145,4 +152,22 @@ with demo:
145
  outputs=[card]
146
  )
147
 
148
- demo.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  table.gr-samples-table tr td:first-of-type {
85
  width: 0%;
86
  }
87
+
 
 
88
  gradio-app > div > div > div > div.w-full > div, .gradio-app > div > div > div > div.w-full > div {
89
  gap: 0px 2%;
90
  }
 
123
 
124
  demo = gr.Blocks(css=CSS)
125
  with demo:
126
+ gr.Markdown("# DocQuery: Document Query Engine")
127
+ gr.Markdown(
128
+ "DocQuery (created by [Impira](https://impira.com)) uses LayoutLMv1 fine-tuned on DocVQA, a document visual question"
129
+ " answering dataset, as well as SQuAD, which boosts its English-language comprehension."
130
+ " To use it, simply upload an image or PDF, type a question, and click 'submit', or "
131
+ " click one of the examples to load them."
132
+ " DocQuery is MIT-licensed and available on [Github](https://github.com/impira/docquery)."
133
+ )
134
  with gr.Row(equal_height=True):
135
  with gr.Column():
136
  with gr.Row():
 
141
  max_lines=1,
142
  elem_id="url-textbox",
143
  )
144
+ button = gr.Button("Generate card", variant="primary")
145
+ clear_button = gr.Button("Clear", variant="secondary")
146
  with gr.Row():
147
  card = gr.HTML()
148
 
 
152
  outputs=[card]
153
  )
154
 
155
+ clear_button.click(
156
+ lambda _: (
157
+ gr.update(visible=False, value=None),
158
+ None,
159
+ None,
160
+ gr.update(visible=False),
161
+ ),
162
+ inputs=clear_button,
163
+ outputs=[
164
+ text,
165
+ button,
166
+ clear_button,
167
+ card,
168
+ ],
169
+ )
170
+
171
+
172
+ if __name__ == "__main__":
173
+ demo.launch()