Albannach58 commited on
Commit
e7255a5
·
verified ·
1 Parent(s): 1b92230

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -17
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
- 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
  """
 
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
  """