Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -52,7 +52,10 @@ def modulus(a: int, b: int) -> int:
|
|
| 52 |
search_tool = DuckDuckGoSearchTool()
|
| 53 |
web_search = VisitWebpageTool()
|
| 54 |
#=======Agent========#
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
| 56 |
agent = CodeAgent(
|
| 57 |
tools=[
|
| 58 |
multiply,
|
|
|
|
| 52 |
search_tool = DuckDuckGoSearchTool()
|
| 53 |
web_search = VisitWebpageTool()
|
| 54 |
#=======Agent========#
|
| 55 |
+
hf_token = os.environ.get("HF_TOKEN")
|
| 56 |
+
if not hf_token:
|
| 57 |
+
raise ValueError("HF_TOKEN not found in environment variables. Please set it in Space Secrets or login via huggingface-cli.")
|
| 58 |
+
model = InferenceClientModel(token=hf_token,'Qwen/Qwen2.5-Coder-32B-Instruct')
|
| 59 |
agent = CodeAgent(
|
| 60 |
tools=[
|
| 61 |
multiply,
|