Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -37,14 +37,11 @@ class MyAgent:
|
|
37 |
)
|
38 |
|
39 |
def __call__(self, question: str) -> str:
|
40 |
-
|
41 |
-
|
42 |
-
{"role": "user", "content": question}
|
43 |
-
]
|
44 |
try:
|
45 |
-
|
46 |
-
|
47 |
-
return extract_final_answer(raw_output)
|
48 |
except Exception as e:
|
49 |
import traceback
|
50 |
traceback.print_exc()
|
|
|
37 |
)
|
38 |
|
39 |
def __call__(self, question: str) -> str:
|
40 |
+
# Combine system prompt and user question as a single input
|
41 |
+
full_prompt = f"{SYSTEM_PROMPT}\n\nUser question: {question}"
|
|
|
|
|
42 |
try:
|
43 |
+
output = self.model.run(full_prompt)
|
44 |
+
return extract_final_answer(output)
|
|
|
45 |
except Exception as e:
|
46 |
import traceback
|
47 |
traceback.print_exc()
|