Timothyxxx commited on
Commit
2afcc05
1 Parent(s): 35c4230
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -8,6 +8,7 @@ import traceback
8
  from typing import Dict
9
  import requests
10
  from utils.utils import load_data_split
 
11
  from nsql.database import NeuralDB
12
  from nsql.nsql_exec import NSQLExecutor
13
  from nsql.nsql_exec_python import NPythonExecutor
@@ -217,10 +218,9 @@ with st.spinner("Generating Binder program to solve the question...will be finis
217
  # Do execution
218
  st.subheader("Binder program")
219
  if selected_language == 'Binder-SQL':
 
 
220
  st.markdown('```sql\n' + binder_program + '\n```')
221
- # st.markdown('```' + binder_program + '```')
222
- # with st.container():
223
- # st.write(binder_program)
224
  executor = NSQLExecutor(args, keys=keys)
225
  elif selected_language == 'Binder-Python':
226
  st.code(binder_program, language='python')
 
8
  from typing import Dict
9
  import requests
10
  from utils.utils import load_data_split
11
+ from utils.normalizer import post_process_sql
12
  from nsql.database import NeuralDB
13
  from nsql.nsql_exec import NSQLExecutor
14
  from nsql.nsql_exec_python import NPythonExecutor
 
218
  # Do execution
219
  st.subheader("Binder program")
220
  if selected_language == 'Binder-SQL':
221
+ # Post process
222
+ binder_program = post_process_sql(binder_program, db, selected_table_title, True)
223
  st.markdown('```sql\n' + binder_program + '\n```')
 
 
 
224
  executor = NSQLExecutor(args, keys=keys)
225
  elif selected_language == 'Binder-Python':
226
  st.code(binder_program, language='python')