Spaces:
Build error
Build error
Ankur Goyal
commited on
Commit
·
3410d4d
1
Parent(s):
d6edad9
Visual edits
Browse files
README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
---
|
| 2 |
-
title: DocQuery
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 3.1.7
|
| 8 |
app_file: app.py
|
|
|
|
| 1 |
---
|
| 2 |
+
title: DocQuery for Invoices
|
| 3 |
+
emoji: 💸
|
| 4 |
+
colorFrom: gray
|
| 5 |
+
colorTo: green
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 3.1.7
|
| 8 |
app_file: app.py
|
app.py
CHANGED
|
@@ -321,6 +321,12 @@ gradio-app h2, .gradio-app h2 {
|
|
| 321 |
#url-error input {
|
| 322 |
color: red;
|
| 323 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 324 |
"""
|
| 325 |
|
| 326 |
with gr.Blocks(css=CSS) as demo:
|
|
@@ -343,7 +349,7 @@ with gr.Blocks(css=CSS) as demo:
|
|
| 343 |
with gr.Row(equal_height=True):
|
| 344 |
with gr.Column():
|
| 345 |
with gr.Row():
|
| 346 |
-
gr.Markdown("##
|
| 347 |
img_clear_button = gr.Button(
|
| 348 |
"Clear", variant="secondary", elem_id="file-clear", visible=False
|
| 349 |
)
|
|
@@ -374,16 +380,17 @@ with gr.Blocks(css=CSS) as demo:
|
|
| 374 |
)
|
| 375 |
|
| 376 |
with gr.Column() as col:
|
|
|
|
| 377 |
with gr.Tabs():
|
| 378 |
with gr.TabItem("Table"):
|
| 379 |
output_table = gr.Dataframe(
|
| 380 |
-
headers=["Field", "Value"], **empty_table(fields.value)
|
|
|
|
| 381 |
)
|
| 382 |
|
| 383 |
with gr.TabItem("JSON"):
|
| 384 |
-
output = gr.JSON(label="Output", visible=
|
| 385 |
|
| 386 |
-
gr.Markdown("## 2. Ask a question")
|
| 387 |
model = gr.Radio(
|
| 388 |
choices=list(CHECKPOINTS.keys()),
|
| 389 |
value=list(CHECKPOINTS.keys())[0],
|
|
@@ -391,6 +398,7 @@ with gr.Blocks(css=CSS) as demo:
|
|
| 391 |
visible=False,
|
| 392 |
)
|
| 393 |
|
|
|
|
| 394 |
with gr.Row():
|
| 395 |
question = gr.Textbox(
|
| 396 |
label="Question",
|
|
@@ -411,7 +419,7 @@ with gr.Blocks(css=CSS) as demo:
|
|
| 411 |
gr.update(visible=False, value=None), # image
|
| 412 |
None, # document
|
| 413 |
# {**FIELDS}, # fields
|
| 414 |
-
gr.update(
|
| 415 |
gr.update(**empty_table(fields.value)), # output_table
|
| 416 |
gr.update(visible=False),
|
| 417 |
None,
|
|
|
|
| 321 |
#url-error input {
|
| 322 |
color: red;
|
| 323 |
}
|
| 324 |
+
|
| 325 |
+
#results-table {
|
| 326 |
+
max-height: 600px;
|
| 327 |
+
overflow-y: scroll;
|
| 328 |
+
}
|
| 329 |
+
|
| 330 |
"""
|
| 331 |
|
| 332 |
with gr.Blocks(css=CSS) as demo:
|
|
|
|
| 349 |
with gr.Row(equal_height=True):
|
| 350 |
with gr.Column():
|
| 351 |
with gr.Row():
|
| 352 |
+
gr.Markdown("## Select an invoice", elem_id="select-a-file")
|
| 353 |
img_clear_button = gr.Button(
|
| 354 |
"Clear", variant="secondary", elem_id="file-clear", visible=False
|
| 355 |
)
|
|
|
|
| 380 |
)
|
| 381 |
|
| 382 |
with gr.Column() as col:
|
| 383 |
+
gr.Markdown("## Results")
|
| 384 |
with gr.Tabs():
|
| 385 |
with gr.TabItem("Table"):
|
| 386 |
output_table = gr.Dataframe(
|
| 387 |
+
headers=["Field", "Value"], **empty_table(fields.value),
|
| 388 |
+
elem_id="results-table"
|
| 389 |
)
|
| 390 |
|
| 391 |
with gr.TabItem("JSON"):
|
| 392 |
+
output = gr.JSON(label="Output", visible=True)
|
| 393 |
|
|
|
|
| 394 |
model = gr.Radio(
|
| 395 |
choices=list(CHECKPOINTS.keys()),
|
| 396 |
value=list(CHECKPOINTS.keys())[0],
|
|
|
|
| 398 |
visible=False,
|
| 399 |
)
|
| 400 |
|
| 401 |
+
gr.Markdown("### Ask a question")
|
| 402 |
with gr.Row():
|
| 403 |
question = gr.Textbox(
|
| 404 |
label="Question",
|
|
|
|
| 419 |
gr.update(visible=False, value=None), # image
|
| 420 |
None, # document
|
| 421 |
# {**FIELDS}, # fields
|
| 422 |
+
gr.update(value=None), # output
|
| 423 |
gr.update(**empty_table(fields.value)), # output_table
|
| 424 |
gr.update(visible=False),
|
| 425 |
None,
|