Spaces:
Runtime error
Runtime error
Timothyxxx
commited on
Commit
·
e727295
1
Parent(s):
97c1059
debug
Browse files
app.py
CHANGED
@@ -200,7 +200,8 @@ question = st.text_input(
|
|
200 |
placeholder=EXAMPLE_TABLES[selected_table_title][1],
|
201 |
)
|
202 |
|
203 |
-
|
|
|
204 |
st.stop()
|
205 |
|
206 |
# Generate Binder Program
|
@@ -226,7 +227,7 @@ else:
|
|
226 |
try:
|
227 |
stamp = '{}'.format(uuid.uuid4())
|
228 |
os.makedirs('tmp_for_vis/', exist_ok=True)
|
229 |
-
with st.spinner("Executing
|
230 |
exec_answer = executor.nsql_exec(stamp, binder_program, db)
|
231 |
if selected_language == 'SQL':
|
232 |
with open("tmp_for_vis/{}_tmp_for_vis_steps.txt".format(stamp), "r") as f:
|
@@ -238,14 +239,14 @@ try:
|
|
238 |
if i == len(steps) - 1:
|
239 |
col1, col1_25, col1_5, col2, col3 = st.columns([5, 0.3, 1.7, 1, 2])
|
240 |
else:
|
241 |
-
col1, col1_25, col1_5, col2, col3 = st.columns([
|
242 |
with col1:
|
243 |
st.markdown('```sql\n' + step + '\n```')
|
244 |
with col1_25:
|
245 |
st.markdown("on")
|
246 |
with col1_5:
|
247 |
if i == len(steps) - 1:
|
248 |
-
st.
|
249 |
else:
|
250 |
with open("tmp_for_vis/{}_result_step_{}_input.txt".format(stamp, i), "r") as f:
|
251 |
sub_tables_input = json.load(f)
|
@@ -256,9 +257,9 @@ try:
|
|
256 |
st.markdown('$\\rightarrow$')
|
257 |
if i == len(steps) - 1:
|
258 |
# The final step
|
259 |
-
st.
|
260 |
else:
|
261 |
-
st.
|
262 |
with st.spinner('...'):
|
263 |
time.sleep(1)
|
264 |
with open("tmp_for_vis/{}_result_step_{}.txt".format(stamp, i), "r") as f:
|
|
|
200 |
placeholder=EXAMPLE_TABLES[selected_table_title][1],
|
201 |
)
|
202 |
|
203 |
+
button = st.button("Run!")
|
204 |
+
if not button:
|
205 |
st.stop()
|
206 |
|
207 |
# Generate Binder Program
|
|
|
227 |
try:
|
228 |
stamp = '{}'.format(uuid.uuid4())
|
229 |
os.makedirs('tmp_for_vis/', exist_ok=True)
|
230 |
+
with st.spinner("Executing program ..."):
|
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:
|
|
|
239 |
if i == len(steps) - 1:
|
240 |
col1, col1_25, col1_5, col2, col3 = st.columns([5, 0.3, 1.7, 1, 2])
|
241 |
else:
|
242 |
+
col1, col1_25, col1_5, col2, col3 = st.columns([4, 0.3, 2.7, 1, 2])
|
243 |
with col1:
|
244 |
st.markdown('```sql\n' + step + '\n```')
|
245 |
with col1_25:
|
246 |
st.markdown("on")
|
247 |
with col1_5:
|
248 |
if i == len(steps) - 1:
|
249 |
+
st.markdown("Full table")
|
250 |
else:
|
251 |
with open("tmp_for_vis/{}_result_step_{}_input.txt".format(stamp, i), "r") as f:
|
252 |
sub_tables_input = json.load(f)
|
|
|
257 |
st.markdown('$\\rightarrow$')
|
258 |
if i == len(steps) - 1:
|
259 |
# The final step
|
260 |
+
st.markdown("{}".format(selected_language))
|
261 |
else:
|
262 |
+
st.markdown("Codex")
|
263 |
with st.spinner('...'):
|
264 |
time.sleep(1)
|
265 |
with open("tmp_for_vis/{}_result_step_{}.txt".format(stamp, i), "r") as f:
|