Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -49,16 +49,10 @@ class _Tee(io.TextIOBase):
|
|
| 49 |
try: st.flush()
|
| 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 |
-
|
| 61 |
-
|
|
|
|
| 62 |
|
| 63 |
# ---------- prompt interne (l'utilisateur ne tape rien) ----------
|
| 64 |
TASK_TMPL = """\
|
|
@@ -169,6 +163,14 @@ def classify(label: str, ean: str):
|
|
| 169 |
print(f"✖ Agent error: {e}")
|
| 170 |
return json.dumps({"error": str(e)}, ensure_ascii=False, indent=2), logs_ui
|
| 171 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
|
| 173 |
def fill_example():
|
| 174 |
# EAN réel OFF (Les p'tits crémeux – Aldi – 216 g)
|
|
|
|
| 49 |
try: st.flush()
|
| 50 |
except Exception: pass
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
+
|
| 54 |
+
# if hasattr(agent, "verbosity_level"):
|
| 55 |
+
# agent.verbosity_level = 3 # 0..3 (3 = très verbeux)
|
| 56 |
|
| 57 |
# ---------- prompt interne (l'utilisateur ne tape rien) ----------
|
| 58 |
TASK_TMPL = """\
|
|
|
|
| 163 |
print(f"✖ Agent error: {e}")
|
| 164 |
return json.dumps({"error": str(e)}, ensure_ascii=False, indent=2), logs_ui
|
| 165 |
|
| 166 |
+
# ---------- instancie l'agent ----------
|
| 167 |
+
try:
|
| 168 |
+
agent = build_agent()
|
| 169 |
+
out = agent.run(task)
|
| 170 |
+
except Exception:
|
| 171 |
+
from quick_deploy_agent import run_task_with_fallback
|
| 172 |
+
out = run_task_with_fallback(task)
|
| 173 |
+
|
| 174 |
|
| 175 |
def fill_example():
|
| 176 |
# EAN réel OFF (Les p'tits crémeux – Aldi – 216 g)
|