Spaces:
Sleeping
Sleeping
,,,
Browse files
app.py
CHANGED
|
@@ -13,11 +13,17 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
| 13 |
class BasicAgent:
|
| 14 |
def __init__(self):
|
| 15 |
print("Initializing smart CodeAgent...")
|
| 16 |
-
# 1. Setup the model engine using the correct class
|
| 17 |
-
# Note: Ensure HUGGINGFACE_TOKEN is added to your Space Secrets for authorization
|
| 18 |
-
self.model = InferenceClientModel(model_id="meta-llama/Llama-3.3-70B-Instruct")
|
| 19 |
|
| 20 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
self.agent = CodeAgent(
|
| 22 |
tools=[DuckDuckGoSearchTool()],
|
| 23 |
model=self.model,
|
|
|
|
| 13 |
class BasicAgent:
|
| 14 |
def __init__(self):
|
| 15 |
print("Initializing smart CodeAgent...")
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
+
# Pull the token automatically from either standard HF Space variables or your manual secrets
|
| 18 |
+
token = os.getenv("HF_TOKEN") or os.getenv("HUGGINGFACE_TOKEN")
|
| 19 |
+
|
| 20 |
+
# 1. Setup a top-tier, non-gated coding model
|
| 21 |
+
self.model = InferenceClientModel(
|
| 22 |
+
model_id="Qwen/Qwen2.5-Coder-32B-Instruct",
|
| 23 |
+
token=token
|
| 24 |
+
)
|
| 25 |
+
|
| 26 |
+
# 2. Build the agent with the search tool
|
| 27 |
self.agent = CodeAgent(
|
| 28 |
tools=[DuckDuckGoSearchTool()],
|
| 29 |
model=self.model,
|