dinesh49 commited on
Commit
8d821f4
·
verified ·
1 Parent(s): 0288791
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -5,10 +5,13 @@ import inspect
5
  import pandas as pd
6
 
7
  from dotenv import load_dotenv
8
- from smolagents import CodeAgent, InferenceClientModel, tool
9
  import wikipedia
10
  from duckduckgo_search import DDGS
11
 
 
 
 
12
  # (Keep Constants as is)
13
  # --- Constants ---
14
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
@@ -82,9 +85,9 @@ class BasicAgent:
82
 
83
  def __init__(self):
84
 
85
- self.model = InferenceClientModel(
86
- model_id="Qwen/Qwen2.5-72B-Instruct",
87
- token=os.getenv("HUGGINGFACE_ACCESS_TOKEN")
88
  )
89
 
90
  self.agent = CodeAgent(
@@ -93,14 +96,14 @@ class BasicAgent:
93
  wikipedia_search,
94
  web_search,
95
  ],
96
- add_base_tools=True
97
  )
98
 
99
  def __call__(self, question: str) -> str:
100
 
101
- answer = self.agent.run(question)
102
 
103
- return str(answer)
104
 
105
  def run_and_submit_all( profile: gr.OAuthProfile | None):
106
  """
 
5
  import pandas as pd
6
 
7
  from dotenv import load_dotenv
8
+ # from smolagents import CodeAgent, InferenceClientModel, tool
9
  import wikipedia
10
  from duckduckgo_search import DDGS
11
 
12
+ from smolagents import CodeAgent, tool
13
+ from smolagents.models import LiteLLMModel
14
+
15
  # (Keep Constants as is)
16
  # --- Constants ---
17
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
 
85
 
86
  def __init__(self):
87
 
88
+ self.model = LiteLLMModel(
89
+ model_id="groq/llama-3.3-70b-versatile",
90
+ api_key=os.getenv("GROQ_API_KEY"),
91
  )
92
 
93
  self.agent = CodeAgent(
 
96
  wikipedia_search,
97
  web_search,
98
  ],
99
+ add_base_tools=True,
100
  )
101
 
102
  def __call__(self, question: str) -> str:
103
 
104
+ response = self.agent.run(question)
105
 
106
+ return str(response)
107
 
108
  def run_and_submit_all( profile: gr.OAuthProfile | None):
109
  """