Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -90,7 +90,15 @@ qa_chain = RetrievalQA.from_chain_type(llm=llm2,
|
|
90 |
chain_type_kwargs={'prompt': prompt})
|
91 |
history_df = pd.DataFrame(columns = ['Question','Answer'])
|
92 |
def qa_bot(query):
|
|
|
93 |
response = qa_chain({'query': query})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
return (response['result'])
|
95 |
|
96 |
st.title("MLSCBot")
|
|
|
90 |
chain_type_kwargs={'prompt': prompt})
|
91 |
history_df = pd.DataFrame(columns = ['Question','Answer'])
|
92 |
def qa_bot(query):
|
93 |
+
global history_df
|
94 |
response = qa_chain({'query': query})
|
95 |
+
print(response)
|
96 |
+
response_df = pd.DataFrame.from_dict([response])
|
97 |
+
response_df.rename(columns = {'query' : 'Question','result' : 'Answer'},inplace = True)
|
98 |
+
history_df = pd.concat([history_df,response_df])
|
99 |
+
history_df.reset_index(drop = True,inplace = True)
|
100 |
+
history_df.to_excel('./responses.xlsx')
|
101 |
+
print(history_df)
|
102 |
return (response['result'])
|
103 |
|
104 |
st.title("MLSCBot")
|