Spaces:
Runtime error
Runtime error
bug fixing... x3
Browse files
app.py
CHANGED
|
@@ -381,6 +381,8 @@ def chat(request: ChatRequest, req: Request):
|
|
| 381 |
if isinstance(chunk, AIMessage) and chunk.content:
|
| 382 |
yield sse_token(chunk.content)
|
| 383 |
except Exception as e:
|
|
|
|
|
|
|
| 384 |
error_str = str(e).lower()
|
| 385 |
if "429" in str(e) or "rate" in error_str:
|
| 386 |
yield sse_error("Rate limited. Please wait a moment and try again.")
|
|
|
|
| 381 |
if isinstance(chunk, AIMessage) and chunk.content:
|
| 382 |
yield sse_token(chunk.content)
|
| 383 |
except Exception as e:
|
| 384 |
+
print(f"[CHAT STREAM EXCEPTION] Final failure: {e}", flush=True)
|
| 385 |
+
import traceback; traceback.print_exc()
|
| 386 |
error_str = str(e).lower()
|
| 387 |
if "429" in str(e) or "rate" in error_str:
|
| 388 |
yield sse_error("Rate limited. Please wait a moment and try again.")
|
graph.py
CHANGED
|
@@ -353,13 +353,10 @@ def chat_node(state: ChatState, config: RunnableConfig):
|
|
| 353 |
resp = llm.invoke([sys] + send_messages, config=config)
|
| 354 |
return {"messages": [resp]}
|
| 355 |
except Exception as e:
|
| 356 |
-
|
| 357 |
last_error = e
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
skip_models.add(model_id)
|
| 361 |
-
continue
|
| 362 |
-
raise
|
| 363 |
|
| 364 |
raise last_error
|
| 365 |
|
|
|
|
| 353 |
resp = llm.invoke([sys] + send_messages, config=config)
|
| 354 |
return {"messages": [resp]}
|
| 355 |
except Exception as e:
|
| 356 |
+
print(f"[ROUTER ERROR] Model {model_id} failed: {e}", flush=True)
|
| 357 |
last_error = e
|
| 358 |
+
skip_models.add(model_id)
|
| 359 |
+
continue
|
|
|
|
|
|
|
|
|
|
| 360 |
|
| 361 |
raise last_error
|
| 362 |
|