JeCabrera commited on
Commit
9b8d7fa
·
verified ·
1 Parent(s): b1cf5e1

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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
- # Simulate stream of chunk
173
- # TODO: Chunk missing `text` if API stops mid-stream ("safety"?)
174
- for ch in chunk.text.split(' '):
175
- full_response += ch + ' '
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