Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -143,24 +143,24 @@ if st.session_state.search:
|
|
143 |
st.write('Oops π΅ Something bad happened...')
|
144 |
# raise e
|
145 |
|
146 |
-
if st.session_state.ask:
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
|
|
143 |
st.write('Oops π΅ Something bad happened...')
|
144 |
# raise e
|
145 |
|
146 |
+
# if st.session_state.ask:
|
147 |
+
# plc_hldr = st.empty()
|
148 |
+
# ctx = st.container()
|
149 |
+
# with plc_hldr.expander('Chat Log', expanded=True):
|
150 |
+
# call_back = None
|
151 |
+
# callback = ChatDataAskCallBackHandler()
|
152 |
+
# try:
|
153 |
+
# ret = st.session_state.chain(
|
154 |
+
# st.session_state.query, callbacks=[callback])
|
155 |
+
# callback.progress_bar.progress(value=1.0, text="Done!")
|
156 |
+
# st.markdown(
|
157 |
+
# f"### Answer from LLM\n{ret['answer']}\n### References")
|
158 |
+
# docs = ret['source_documents']
|
159 |
+
# ref = re.findall(
|
160 |
+
# '(http://arxiv.org/abs/\d{4}.\d+v\d)', ret['sources'])
|
161 |
+
# docs = pd.DataFrame([{**d.metadata, 'abstract': d.page_content}
|
162 |
+
# for d in docs if d.metadata['id'] in ref])
|
163 |
+
# display(docs, columns)
|
164 |
+
# except Exception as e:
|
165 |
+
# st.write('Oops π΅ Something bad happened...')
|
166 |
+
# # raise e
|