Spaces:
Sleeping
Sleeping
arthurcarvalho
commited on
Commit
•
8abb177
1
Parent(s):
bea0cb1
Upload app.py
Browse files
app.py
CHANGED
@@ -35,9 +35,7 @@ if prompt := st.chat_input("How can I help you today?"):
|
|
35 |
],
|
36 |
stream=True,
|
37 |
):
|
38 |
-
full_response += response.choices[0].delta.get("content", "")
|
39 |
-
|
40 |
-
|
41 |
-
#message_placeholder.markdown(full_response) #causes problems with responses having $, which is interpreted as equation in markdown
|
42 |
-
message_placeholder.write(full_response + "▌")
|
43 |
st.session_state.messages.append({"role": "assistant", "content": full_response})
|
|
|
35 |
],
|
36 |
stream=True,
|
37 |
):
|
38 |
+
full_response += response.choices[0].delta.get("content", "").replace('$','\\$')
|
39 |
+
message_placeholder.markdown(full_response + "▌")
|
40 |
+
message_placeholder.markdown(full_response)
|
|
|
|
|
41 |
st.session_state.messages.append({"role": "assistant", "content": full_response})
|