2MoOn24mOoN4 commited on
Commit
d80498a
·
verified ·
1 Parent(s): caaf215

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +4 -1
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
- model = InferenceClientModel('Qwen/Qwen2.5-Coder-32B-Instruct')
 
 
 
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,