wishwakankanamg commited on
Commit
3b91398
·
1 Parent(s): 8bf9ff4
Files changed (2) hide show
  1. __pycache__/agent.cpython-310.pyc +0 -0
  2. agent.py +8 -1
__pycache__/agent.cpython-310.pyc CHANGED
Binary files a/__pycache__/agent.cpython-310.pyc and b/__pycache__/agent.cpython-310.pyc differ
 
agent.py CHANGED
@@ -150,6 +150,10 @@ tools = [
150
  arvix_search,
151
  ]
152
 
 
 
 
 
153
  # Build graph function
154
  def build_graph(provider: str = "groq"):
155
  """Build the graph"""
@@ -162,10 +166,13 @@ def build_graph(provider: str = "groq"):
162
  llm = ChatGroq(model="qwen-qwq-32b", temperature=0) # optional : qwen-qwq-32b gemma2-9b-it
163
  elif provider == "huggingface":
164
  # TODO: Add huggingface endpoint
 
165
  llm = ChatHuggingFace(
 
166
  llm=HuggingFaceEndpoint(
167
- url="https://api-inference.huggingface.co/models/Meta-DeepLearning/llama-2-7b-chat-hf",
168
  temperature=0,
 
169
  ),
170
  )
171
  else:
 
150
  arvix_search,
151
  ]
152
 
153
+ hf_token = os.environ.get('HF_TOKEN')
154
+ if not hf_token:
155
+ raise ValueError("Hugging Face API token (HF_TOKEN) not found in environment variables.")
156
+
157
  # Build graph function
158
  def build_graph(provider: str = "groq"):
159
  """Build the graph"""
 
166
  llm = ChatGroq(model="qwen-qwq-32b", temperature=0) # optional : qwen-qwq-32b gemma2-9b-it
167
  elif provider == "huggingface":
168
  # TODO: Add huggingface endpoint
169
+ repo_id = "mistralai/Mistral-7B-Instruct-v0.2"
170
  llm = ChatHuggingFace(
171
+
172
  llm=HuggingFaceEndpoint(
173
+ repo_id=repo_id,
174
  temperature=0,
175
+ huggingfacehub_api_token= hf_token
176
  ),
177
  )
178
  else: