Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,7 +16,7 @@ class AwesomeAgent:
|
|
| 16 |
|
| 17 |
def __init__(self):
|
| 18 |
print("AwesomeAgent initialised.")
|
| 19 |
-
self.agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=HfApiModel(
|
| 20 |
|
| 21 |
SYSTEM_PROMPT = """
|
| 22 |
You are a precise, domain-agnostic assistant. For every query, perform internal reasoning silently and respond only with a conclusive output using this format:
|
|
@@ -39,9 +39,12 @@ class AwesomeAgent:
|
|
| 39 |
|
| 40 |
def __call__(self, question: str) -> str:
|
| 41 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 42 |
-
|
| 43 |
-
print(f"
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
|
| 47 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
|
|
| 16 |
|
| 17 |
def __init__(self):
|
| 18 |
print("AwesomeAgent initialised.")
|
| 19 |
+
self.agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=HfApiModel(model="mistralai/Mistral-7B-Instruct-v0.2"))
|
| 20 |
|
| 21 |
SYSTEM_PROMPT = """
|
| 22 |
You are a precise, domain-agnostic assistant. For every query, perform internal reasoning silently and respond only with a conclusive output using this format:
|
|
|
|
| 39 |
|
| 40 |
def __call__(self, question: str) -> str:
|
| 41 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 42 |
+
raw = self.agent.run(question)
|
| 43 |
+
print(f"Raw model output: {raw}")
|
| 44 |
+
for line in raw.splitlines():
|
| 45 |
+
if "FINAL:" in line:
|
| 46 |
+
return line.split("FINAL:")[-1].strip().strip('".,')
|
| 47 |
+
return raw.strip()
|
| 48 |
|
| 49 |
|
| 50 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|