shashank970613 commited on
Commit
1f97194
·
verified ·
1 Parent(s): b2a5d5a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -2,7 +2,7 @@ import os
2
  import requests
3
  import gradio as gr
4
  import spaces
5
- from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, tool
6
 
7
  # 1. Custom tool to download files if needed for tasks
8
  @tool
@@ -22,8 +22,8 @@ def get_file_content_tool(task_id: str) -> str:
22
  return f"File downloaded successfully as {filename}."
23
  return f"Failed to download file for task {task_id}"
24
 
25
- # 2. Initialize the model using HfApiModel properly
26
- model = HfApiModel(model_id="Qwen/Qwen2.5-Coder-32B-Instruct")
27
 
28
  agent = CodeAgent(
29
  tools=[DuckDuckGoSearchTool(), get_file_content_tool],
 
2
  import requests
3
  import gradio as gr
4
  import spaces
5
+ from smolagents import CodeAgent, DuckDuckGoSearchTool, InferenceClientModel, tool
6
 
7
  # 1. Custom tool to download files if needed for tasks
8
  @tool
 
22
  return f"File downloaded successfully as {filename}."
23
  return f"Failed to download file for task {task_id}"
24
 
25
+ # 2. Initialize the model using InferenceClientModel
26
+ model = InferenceClientModel(model_id="Qwen/Qwen2.5-Coder-32B-Instruct")
27
 
28
  agent = CodeAgent(
29
  tools=[DuckDuckGoSearchTool(), get_file_content_tool],