Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
@@ -107,6 +107,11 @@ if prompt := st.chat_input('¿En qué puedo ayudarte hoy?'): # Mensaje más ami
|
|
107 |
message_placeholder = st.empty()
|
108 |
full_response = ''
|
109 |
assistant_response = response
|
|
|
|
|
|
|
|
|
|
|
110 |
# Streams in a chunk at a time
|
111 |
for chunk in response:
|
112 |
# Simulate stream of chunk
|
@@ -116,6 +121,8 @@ if prompt := st.chat_input('¿En qué puedo ayudarte hoy?'): # Mensaje más ami
|
|
116 |
time.sleep(0.05)
|
117 |
# Rewrites with a cursor at end
|
118 |
message_placeholder.write(full_response + '▌')
|
|
|
|
|
119 |
# Write full message with placeholder
|
120 |
message_placeholder.write(full_response)
|
121 |
|
|
|
107 |
message_placeholder = st.empty()
|
108 |
full_response = ''
|
109 |
assistant_response = response
|
110 |
+
|
111 |
+
# Añade un indicador de "escribiendo..."
|
112 |
+
typing_indicator = st.empty()
|
113 |
+
typing_indicator.markdown("*RoboCopy está escribiendo...*")
|
114 |
+
|
115 |
# Streams in a chunk at a time
|
116 |
for chunk in response:
|
117 |
# Simulate stream of chunk
|
|
|
121 |
time.sleep(0.05)
|
122 |
# Rewrites with a cursor at end
|
123 |
message_placeholder.write(full_response + '▌')
|
124 |
+
# Elimina el indicador de escritura
|
125 |
+
typing_indicator.empty()
|
126 |
# Write full message with placeholder
|
127 |
message_placeholder.write(full_response)
|
128 |
|