Spaces:
Running
Running
Commit
·
ae89963
1
Parent(s):
4689af3
Update page1.py
Browse files
page1.py
CHANGED
|
@@ -156,22 +156,22 @@ def text():
|
|
| 156 |
}
|
| 157 |
)
|
| 158 |
|
| 159 |
-
with st.chat_message("assistant"):
|
| 160 |
-
message_placeholder = st.empty()
|
| 161 |
-
full_response = ""
|
| 162 |
-
assistant_response = random.choice(
|
| 163 |
-
[
|
| 164 |
-
"Hello there! How can I assist you today?",
|
| 165 |
-
"Hi, human! Is there anything I can help you with?",
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
# Simulate stream of response with milliseconds delay
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
# Add a blinking cursor to simulate typing
|
| 174 |
-
|
| 175 |
-
|
| 176 |
# Add assistant response to chat history
|
| 177 |
-
|
|
|
|
| 156 |
}
|
| 157 |
)
|
| 158 |
|
| 159 |
+
#with st.chat_message("assistant"):
|
| 160 |
+
#message_placeholder = st.empty()
|
| 161 |
+
#full_response = ""
|
| 162 |
+
#assistant_response = random.choice(
|
| 163 |
+
#[
|
| 164 |
+
#"Hello there! How can I assist you today?",
|
| 165 |
+
#"Hi, human! Is there anything I can help you with?",
|
| 166 |
+
# "Do you need help?",
|
| 167 |
+
# ]
|
| 168 |
+
# )
|
| 169 |
# Simulate stream of response with milliseconds delay
|
| 170 |
+
# for chunk in text_output.split():
|
| 171 |
+
# full_response += chunk + " "
|
| 172 |
+
# time.sleep(0.05)
|
| 173 |
# Add a blinking cursor to simulate typing
|
| 174 |
+
# message_placeholder.markdown(full_response + "▌")
|
| 175 |
+
# message_placeholder.markdown(full_response)
|
| 176 |
# Add assistant response to chat history
|
| 177 |
+
# st.session_state.messages.append({"role": "assistant", "content": full_response})
|