Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
@@ -169,13 +169,13 @@ if prompt := st.chat_input('¿En qué puedo ayudarte hoy?'): # Mensaje más ami
|
|
169 |
|
170 |
# Streams in a chunk at a time
|
171 |
for chunk in response:
|
172 |
-
#
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
time.sleep(0.1) # Aumentado de 0.05 a 0.1 segundos para una velocidad más lenta
|
177 |
# Rewrites with a cursor at end
|
178 |
message_placeholder.write(full_response + '▌')
|
|
|
179 |
# Elimina el indicador de escritura
|
180 |
typing_indicator.empty()
|
181 |
# Write full message with placeholder
|
|
|
169 |
|
170 |
# Streams in a chunk at a time
|
171 |
for chunk in response:
|
172 |
+
# Procesa el texto caracter por caracter
|
173 |
+
for char in chunk.text:
|
174 |
+
full_response += char
|
175 |
+
time.sleep(0.02) # Velocidad ajustada para mejor legibilidad
|
|
|
176 |
# Rewrites with a cursor at end
|
177 |
message_placeholder.write(full_response + '▌')
|
178 |
+
|
179 |
# Elimina el indicador de escritura
|
180 |
typing_indicator.empty()
|
181 |
# Write full message with placeholder
|