Hmd6919 commited on
Commit
f4d6664
·
verified ·
1 Parent(s): 353d382

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -2,14 +2,20 @@ import os
2
  import gradio as gr
3
  import requests
4
  import pandas as pd
5
- from smolagents import CodeAgent, DuckDuckGoSearchTool, HfEngine
6
 
 
 
 
 
7
  def create_agent():
8
- # Use Hugging Face Inference API
9
- model = HfEngine(model_id="Qwen/Qwen2.5-Coder-32B-Instruct")
10
 
 
11
  search_tool = DuckDuckGoSearchTool()
12
 
 
13
  agent = CodeAgent(
14
  tools=[search_tool],
15
  model=model,
 
2
  import gradio as gr
3
  import requests
4
  import pandas as pd
5
+ from smolagents import CodeAgent, DuckDuckGoSearchTool, HfEngine #
6
 
7
+ # --- Constants ---
8
+ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
9
+
10
+ # --- Agent Definition ---
11
  def create_agent():
12
+ # We use Qwen2.5-Coder as the brain 🧠
13
+ model = HfEngine(model_id="Qwen/Qwen2.5-Coder-32B-Instruct") #
14
 
15
+ # We give it the search tool so it can find answers on the web 🔍
16
  search_tool = DuckDuckGoSearchTool()
17
 
18
+ # The CodeAgent can write Python to solve complex problems 🐍
19
  agent = CodeAgent(
20
  tools=[search_tool],
21
  model=model,