Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -11,25 +11,25 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
11 |
|
12 |
# --- Basic Agent Definition ---
|
13 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
14 |
-
model = InferenceClientModel()#TransformersModel(model_id="HuggingFaceTB/SmolLM-135M-Instruct", max_length=4096)
|
15 |
tools = [DuckDuckGoSearchTool()]
|
16 |
|
17 |
-
class BasicAgent(CodeAgent):
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
|
34 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
35 |
"""
|
|
|
11 |
|
12 |
# --- Basic Agent Definition ---
|
13 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
14 |
+
model = InferenceClientModel() #TransformersModel(model_id="HuggingFaceTB/SmolLM-135M-Instruct", max_length=4096)
|
15 |
tools = [DuckDuckGoSearchTool()]
|
16 |
|
17 |
+
# class BasicAgent(CodeAgent):
|
18 |
+
# def __init__(self):
|
19 |
+
# self = CodeAgent(tools=tools, model=model, additional_authorized_imports=["requests", "bs4"], max_steps=20)
|
20 |
+
# print("BasicAgent initialized as CodeAgent.")
|
21 |
+
# def __call__(self, question: str) -> str:
|
22 |
+
# # Run the agent with the query
|
23 |
+
# print(question)
|
24 |
+
# result = self.run(question)
|
25 |
+
# return result
|
26 |
+
# # n = 50
|
27 |
+
# # if (question.startswith("How many studio albums were published by Mercedes")):
|
28 |
+
# # n = len(question)
|
29 |
+
# # print(f"Agent received question (first 50 chars): {question[:n]}...")
|
30 |
+
# # fixed_answer = "This is a default answer."
|
31 |
+
# # print(f"Agent returning fixed answer: {fixed_answer}")
|
32 |
+
# # return fixed_answer
|
33 |
|
34 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
35 |
"""
|