Spaces:
Runtime error
Runtime error
Timothyxxx
commited on
Commit
·
3474cf6
1
Parent(s):
0eca8c1
Fix small bugs
Browse files
app.py
CHANGED
@@ -27,7 +27,7 @@ st.set_page_config(
|
|
27 |
ROOT_DIR = os.path.join(os.path.dirname(__file__), "./")
|
28 |
# todo: Add more binder questions, need careful cherry-picks
|
29 |
EXAMPLE_TABLES = {
|
30 |
-
"Estonia men's national volleyball team": (558, "what
|
31 |
# 'how old is kert toobal'
|
32 |
"Highest mountain peaks of California": (5, "which is the lowest mountain?"),
|
33 |
# 'which mountain is in the most north place?'
|
@@ -206,7 +206,7 @@ if not button:
|
|
206 |
|
207 |
# Generate Binder Program
|
208 |
generator = Generator(args, keys=keys)
|
209 |
-
with st.spinner("Generating Binder program to solve the question..."):
|
210 |
binder_program = generate_binder_program(args, generator,
|
211 |
{"question": question, "table": db.get_table_df(), "title": title})
|
212 |
|
@@ -227,7 +227,7 @@ else:
|
|
227 |
try:
|
228 |
stamp = '{}'.format(uuid.uuid4())
|
229 |
os.makedirs('tmp_for_vis/', exist_ok=True)
|
230 |
-
with st.spinner("Executing
|
231 |
exec_answer = executor.nsql_exec(stamp, binder_program, db)
|
232 |
if selected_language == 'SQL':
|
233 |
with open("tmp_for_vis/{}_tmp_for_vis_steps.txt".format(stamp), "r") as f:
|
|
|
27 |
ROOT_DIR = os.path.join(os.path.dirname(__file__), "./")
|
28 |
# todo: Add more binder questions, need careful cherry-picks
|
29 |
EXAMPLE_TABLES = {
|
30 |
+
"Estonia men's national volleyball team": (558, "what is the total number of players from france?"),
|
31 |
# 'how old is kert toobal'
|
32 |
"Highest mountain peaks of California": (5, "which is the lowest mountain?"),
|
33 |
# 'which mountain is in the most north place?'
|
|
|
206 |
|
207 |
# Generate Binder Program
|
208 |
generator = Generator(args, keys=keys)
|
209 |
+
with st.spinner("Generating Binder program to solve the question...will be finished in 10s, please refresh the page if not"):
|
210 |
binder_program = generate_binder_program(args, generator,
|
211 |
{"question": question, "table": db.get_table_df(), "title": title})
|
212 |
|
|
|
227 |
try:
|
228 |
stamp = '{}'.format(uuid.uuid4())
|
229 |
os.makedirs('tmp_for_vis/', exist_ok=True)
|
230 |
+
with st.spinner("Executing... will be finished in 30s, please refresh the page if not"):
|
231 |
exec_answer = executor.nsql_exec(stamp, binder_program, db)
|
232 |
if selected_language == 'SQL':
|
233 |
with open("tmp_for_vis/{}_tmp_for_vis_steps.txt".format(stamp), "r") as f:
|