Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
@@ -239,7 +239,7 @@ def process_model_response(prompt, max_retries=3):
|
|
239 |
full_text = "".join(chunk.text for chunk in response)
|
240 |
|
241 |
# Llamada corregida
|
242 |
-
mensaje_mostrado = mostrar_con_efecto_escritura(full_text, velocidad=0.05
|
243 |
|
244 |
add_message(MODEL_ROLE, mensaje_mostrado, AI_AVATAR_ICON)
|
245 |
st.session_state.gemini_history = st.session_state.chat.history
|
@@ -250,7 +250,7 @@ def process_model_response(prompt, max_retries=3):
|
|
250 |
retry_count += 1
|
251 |
if handle_model_error(e, retry_count, max_retries):
|
252 |
return False
|
253 |
-
wait_time = (
|
254 |
time.sleep(wait_time)
|
255 |
return False
|
256 |
|
|
|
239 |
full_text = "".join(chunk.text for chunk in response)
|
240 |
|
241 |
# Llamada corregida
|
242 |
+
mensaje_mostrado = mostrar_con_efecto_escritura(full_text, velocidad=0.03) # Reducir de 0.05 a 0.02
|
243 |
|
244 |
add_message(MODEL_ROLE, mensaje_mostrado, AI_AVATAR_ICON)
|
245 |
st.session_state.gemini_history = st.session_state.chat.history
|
|
|
250 |
retry_count += 1
|
251 |
if handle_model_error(e, retry_count, max_retries):
|
252 |
return False
|
253 |
+
wait_time = (1.5 ** retry_count) # Reducir crecimiento exponencial
|
254 |
time.sleep(wait_time)
|
255 |
return False
|
256 |
|