sqfoo commited on
Commit
39b5432
·
verified ·
1 Parent(s): d92f9e3

replace HfAPI with LiteLLM due to payment issue

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -10,14 +10,18 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
10
 
11
  # --- Basic Agent Definition ---
12
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
13
- from smolagents import CodeAgent, DuckDuckGoSearchTool, OpenAIServerModel, VLLMModel, HfApiModel
14
 
15
 
16
  class BasicAgent:
17
  def __init__(self):
18
  # model = OpenAIServerModel(model_id="gpt-4o")
19
  # model = VLLMModel(model_id="HuggingFaceTB/SmolLM-135M-Instruct")
20
- model = HfApiModel("Qwen/Qwen2.5-Coder-32B-Instruct")
 
 
 
 
21
  self.agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=model)
22
  print("BasicAgent initialized.")
23
  def __call__(self, question: str) -> str:
 
10
 
11
  # --- Basic Agent Definition ---
12
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
13
+ from smolagents import CodeAgent, DuckDuckGoSearchTool, OpenAIServerModel, VLLMModel, HfApiModel, LiteLLMModel
14
 
15
 
16
  class BasicAgent:
17
  def __init__(self):
18
  # model = OpenAIServerModel(model_id="gpt-4o")
19
  # model = VLLMModel(model_id="HuggingFaceTB/SmolLM-135M-Instruct")
20
+ model = LiteLLMModel(
21
+ model_id="Qwen/Qwen2.5-Coder-32B-Instruct",
22
+ num_ctx=8192,
23
+ )
24
+ # model = HfApiModel("Qwen/Qwen2.5-Coder-32B-Instruct")
25
  self.agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=model)
26
  print("BasicAgent initialized.")
27
  def __call__(self, question: str) -> str: