muzammil-eds commited on
Commit
01d0c35
1 Parent(s): cb43836

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -4,7 +4,7 @@ import pickle
4
  import time
5
  import requests
6
 
7
- st.set_page_config(page_title="LEGAL ASSISTANT")
8
 
9
  st.markdown(
10
  """
@@ -87,7 +87,7 @@ def main_app():
87
  "chat_history": []
88
 
89
  }
90
- response = requests.post('http://18.190.164.123:8000/generate', json=json)
91
 
92
  return response.json()
93
 
@@ -100,7 +100,11 @@ def main_app():
100
  with st.spinner("Thinking..."):
101
  response = generate_response(prompt)
102
  st.markdown(response['response'])
103
- st.session_state.current_conversation.append({"role": "assistant", "content": response['response']})
 
 
 
 
104
  save_conversations(st.session_state.conversations)
105
 
106
 
 
4
  import time
5
  import requests
6
 
7
+ st.set_page_config(page_title="Psychedelics GPT")
8
 
9
  st.markdown(
10
  """
 
87
  "chat_history": []
88
 
89
  }
90
+ response = requests.post('http://3.223.163.181:8090/generate', json=json)
91
 
92
  return response.json()
93
 
 
100
  with st.spinner("Thinking..."):
101
  response = generate_response(prompt)
102
  st.markdown(response['response'])
103
+ sources_str = 'References:\n' + '\n'.join(
104
+ [f'{idx + 1}. {source}' for idx, source in enumerate(response['sources'])])
105
+ st.markdown(sources_str)
106
+ st.session_state.current_conversation.append(
107
+ {"role": "assistant", "content": response['response'] + "\n" + sources_str})
108
  save_conversations(st.session_state.conversations)
109
 
110