Update app.py
Browse files
app.py
CHANGED
|
@@ -39,8 +39,10 @@ if prompt := st.chat_input("How can I help you today?"):
|
|
| 39 |
],
|
| 40 |
stream=True,
|
| 41 |
):
|
| 42 |
-
|
| 43 |
-
|
|
|
|
|
|
|
| 44 |
message_placeholder.markdown(full_response)
|
| 45 |
print(full_response)
|
| 46 |
st.session_state.messages.append({"role": "assistant", "content": full_response})
|
|
|
|
| 39 |
],
|
| 40 |
stream=True,
|
| 41 |
):
|
| 42 |
+
for chunk in response:
|
| 43 |
+
if chunk.choices[0].delta.content is not None:
|
| 44 |
+
full_response += chunk.choices[0].delta.content.replace('\\$','$').replace('$','\\$')
|
| 45 |
+
message_placeholder.markdown(full_response + "▌")
|
| 46 |
message_placeholder.markdown(full_response)
|
| 47 |
print(full_response)
|
| 48 |
st.session_state.messages.append({"role": "assistant", "content": full_response})
|