ogegadavis254 commited on
Commit
b6d6706
·
verified ·
1 Parent(s): 98812f4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -147,12 +147,13 @@ if prompt := st.chat_input(f"Hi, I'm {selected_model}, ask me a question"):
147
  if selected_model == "Nous-Hermes-2-Yi-34B":
148
  stream = interact_with_together_api(st.session_state.messages)
149
  else:
150
- interact_with_huggingface_model(st.session_state.messages, model_links[selected_model])
151
 
152
  # Display assistant response in chat message container
153
  with st.chat_message("assistant"):
154
  response = ""
155
- for chunk in stream:
156
- response = chunk
157
- st.markdown(response)
 
158
  st.session_state.messages.append(("assistant", response))
 
147
  if selected_model == "Nous-Hermes-2-Yi-34B":
148
  stream = interact_with_together_api(st.session_state.messages)
149
  else:
150
+ stream = interact_with_huggingface_model(st.session_state.messages, model_links[selected_model])
151
 
152
  # Display assistant response in chat message container
153
  with st.chat_message("assistant"):
154
  response = ""
155
+ if stream:
156
+ for chunk in stream:
157
+ response = chunk
158
+ st.markdown(response)
159
  st.session_state.messages.append(("assistant", response))