Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
156 |
-
|
157 |
-
|
|
|
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))
|