Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ import gradio as gr
|
|
| 4 |
from contextlib import redirect_stdout, redirect_stderr
|
| 5 |
|
| 6 |
# 👉 adapte le module si ton fichier agent a un autre nom
|
| 7 |
-
from quick_deploy_agent import build_agent, parse_result
|
| 8 |
|
| 9 |
|
| 10 |
# --- en haut de app.py, ajoute cet util ---
|
|
@@ -50,7 +50,13 @@ class _Tee(io.TextIOBase):
|
|
| 50 |
except Exception: pass
|
| 51 |
|
| 52 |
# ---------- instancie l'agent + logs verbeux ----------
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
if hasattr(agent, "verbosity_level"):
|
| 55 |
agent.verbosity_level = 3 # 0..3 (3 = très verbeux)
|
| 56 |
|
|
|
|
| 4 |
from contextlib import redirect_stdout, redirect_stderr
|
| 5 |
|
| 6 |
# 👉 adapte le module si ton fichier agent a un autre nom
|
| 7 |
+
from quick_deploy_agent import build_agent, parse_result, run_task_with_fallback
|
| 8 |
|
| 9 |
|
| 10 |
# --- en haut de app.py, ajoute cet util ---
|
|
|
|
| 50 |
except Exception: pass
|
| 51 |
|
| 52 |
# ---------- instancie l'agent + logs verbeux ----------
|
| 53 |
+
try:
|
| 54 |
+
agent = build_agent()
|
| 55 |
+
out = agent.run(task)
|
| 56 |
+
except Exception:
|
| 57 |
+
from quick_deploy_agent import run_task_with_fallback
|
| 58 |
+
out = run_task_with_fallback(task)
|
| 59 |
+
|
| 60 |
if hasattr(agent, "verbosity_level"):
|
| 61 |
agent.verbosity_level = 3 # 0..3 (3 = très verbeux)
|
| 62 |
|