Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,20 +2,13 @@ import os
|
|
| 2 |
import gradio as gr
|
| 3 |
import requests
|
| 4 |
import pandas as pd
|
| 5 |
-
from smolagents import CodeAgent, DuckDuckGoSearchTool,
|
| 6 |
|
| 7 |
-
# --- Constants ---
|
| 8 |
-
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 9 |
-
|
| 10 |
-
# --- Agent Definition ---
|
| 11 |
def create_agent():
|
| 12 |
-
|
| 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,
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
import requests
|
| 4 |
import pandas as pd
|
| 5 |
+
from smolagents import CodeAgent, DuckDuckGoSearchTool, LiteLLMModel
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
def create_agent():
|
| 8 |
+
model = LiteLLMModel(model_id="huggingface/Qwen/Qwen2.5-Coder-32B-Instruct")
|
|
|
|
| 9 |
|
|
|
|
| 10 |
search_tool = DuckDuckGoSearchTool()
|
| 11 |
|
|
|
|
| 12 |
agent = CodeAgent(
|
| 13 |
tools=[search_tool],
|
| 14 |
model=model,
|