Spaces:
Runtime error
Runtime error
Fixes to solve code deprecation
Browse files- app.py +7 -8
- requirements.txt +5 -4
app.py
CHANGED
@@ -12,23 +12,22 @@ def main():
|
|
12 |
article = "<p style='text-align: center'><a href='https://katanaml.io' target='_blank'>Katana ML</a> | <a href='https://github.com/katanaml/table-query-model' target='_blank'>Github Repo</a> | <a href='https://huggingface.co/google/tapas-base-finetuned-wtq' target='_blank'>TAPAS Model</a></p><center><img src='https://visitor-badge.glitch.me/badge?page_id=abaranovskij_tablequery' alt='visitor badge'></center>"
|
13 |
|
14 |
iface = gr.Interface(fn=execute_query,
|
15 |
-
inputs=[gr.
|
16 |
-
gr.
|
17 |
-
outputs=[gr.
|
18 |
-
gr.
|
19 |
examples=[
|
20 |
["What are the items with total higher than 8?", "taxables.csv"],
|
21 |
["What is the cost for Maxwell item?", "taxables.csv"],
|
22 |
["Show items with cost lower than 2 and tax higher than 0.05", "taxables.csv"]
|
23 |
],
|
24 |
-
theme="huggingface",
|
25 |
title="Table Question Answering (TAPAS)",
|
26 |
description=description,
|
27 |
article=article,
|
28 |
-
allow_flagging=
|
29 |
# Use this config when running on Docker
|
30 |
-
|
31 |
-
iface.launch(enable_queue=True)
|
32 |
|
33 |
|
34 |
if __name__ == "__main__":
|
|
|
12 |
article = "<p style='text-align: center'><a href='https://katanaml.io' target='_blank'>Katana ML</a> | <a href='https://github.com/katanaml/table-query-model' target='_blank'>Github Repo</a> | <a href='https://huggingface.co/google/tapas-base-finetuned-wtq' target='_blank'>TAPAS Model</a></p><center><img src='https://visitor-badge.glitch.me/badge?page_id=abaranovskij_tablequery' alt='visitor badge'></center>"
|
13 |
|
14 |
iface = gr.Interface(fn=execute_query,
|
15 |
+
inputs=[gr.Textbox(label="Search query"),
|
16 |
+
gr.File(label="CSV file")],
|
17 |
+
outputs=[gr.JSON(label="Result"),
|
18 |
+
gr.Dataframe(label="All data")],
|
19 |
examples=[
|
20 |
["What are the items with total higher than 8?", "taxables.csv"],
|
21 |
["What is the cost for Maxwell item?", "taxables.csv"],
|
22 |
["Show items with cost lower than 2 and tax higher than 0.05", "taxables.csv"]
|
23 |
],
|
|
|
24 |
title="Table Question Answering (TAPAS)",
|
25 |
description=description,
|
26 |
article=article,
|
27 |
+
allow_flagging='never')
|
28 |
# Use this config when running on Docker
|
29 |
+
iface.launch(server_name="0.0.0.0", server_port=7000)
|
30 |
+
# iface.launch(enable_queue=True)
|
31 |
|
32 |
|
33 |
if __name__ == "__main__":
|
requirements.txt
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
-
gradio
|
2 |
-
tensorflow==2.
|
3 |
-
transformers==4.
|
4 |
-
tensorflow_probability
|
|
|
|
1 |
+
gradio==3.15.0
|
2 |
+
tensorflow==2.11.0
|
3 |
+
transformers==4.25.1
|
4 |
+
tensorflow_probability
|
5 |
+
jinja2
|