Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -130,24 +130,13 @@ if __name__ == '__main__':
|
|
| 130 |
except:
|
| 131 |
pass
|
| 132 |
|
| 133 |
-
if db_chain.intermediate_steps.get("
|
| 134 |
-
|
| 135 |
-
#st.markdown("Sorry I cannot answer that. Please try again later.")
|
| 136 |
-
response = "Sorry I cannot answer that. Please try again later."
|
| 137 |
-
elif db_chain.intermediate_steps.get("result",'') != '':
|
| 138 |
-
#st.markdown("Answer to your question is - " + db_chain.intermediate_steps.get("result",''))
|
| 139 |
-
#print (db_chain.intermediate_steps.get("result",''))
|
| 140 |
-
#st.markdown("The SQL query is - " + db_chain.intermediate_steps['sql_cmd'])
|
| 141 |
-
response = "Answer to your question is - " + db_chain.intermediate_steps.get("result",'')
|
| 142 |
elif db_chain.intermediate_steps.get("sql_data",'') != '':
|
| 143 |
out = pd.DataFrame.from_dict(db_chain.intermediate_steps['sql_data'])
|
| 144 |
-
#st.markdown("Here is your result in a table format")
|
| 145 |
-
#st.table(out)
|
| 146 |
-
#st.markdown("The SQL query is - " + db_chain.intermediate_steps['sql_cmd'])
|
| 147 |
response = tabulate(out, headers='keys', tablefmt='psql')
|
| 148 |
else:
|
| 149 |
-
|
| 150 |
-
response = "Sorry I cannot answer that. Please try again later."
|
| 151 |
|
| 152 |
responses.append(response)
|
| 153 |
st.session_state['history'].append(db_chain.intermediate_steps.get("result",''))
|
|
|
|
| 130 |
except:
|
| 131 |
pass
|
| 132 |
|
| 133 |
+
if db_chain.intermediate_steps.get("result",'') != '':
|
| 134 |
+
response = db_chain.intermediate_steps.get("result",'')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
elif db_chain.intermediate_steps.get("sql_data",'') != '':
|
| 136 |
out = pd.DataFrame.from_dict(db_chain.intermediate_steps['sql_data'])
|
|
|
|
|
|
|
|
|
|
| 137 |
response = tabulate(out, headers='keys', tablefmt='psql')
|
| 138 |
else:
|
| 139 |
+
response = ""
|
|
|
|
| 140 |
|
| 141 |
responses.append(response)
|
| 142 |
st.session_state['history'].append(db_chain.intermediate_steps.get("result",''))
|