superone001 commited on
Commit
77444cc
·
verified ·
1 Parent(s): cd46885

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +5 -6
agent.py CHANGED
@@ -16,12 +16,11 @@ def build_graph():
16
  # 1. 初始化模型 - 使用HuggingFace免费接口
17
  llm = HuggingFaceEndpoint(
18
  endpoint_url="https://api-inference.huggingface.co/models/mistralai/Mistral-7B-Instruct-v0.2",
19
- task="text-generation",
20
- model_kwargs={
21
- "temperature": 0.1,
22
- "max_new_tokens": 500,
23
- "repetition_penalty": 1.2
24
- }
25
  )
26
 
27
  # 2. 创建ReAct代理
 
16
  # 1. 初始化模型 - 使用HuggingFace免费接口
17
  llm = HuggingFaceEndpoint(
18
  endpoint_url="https://api-inference.huggingface.co/models/mistralai/Mistral-7B-Instruct-v0.2",
19
+ max_new_tokens=500, # 直接指定
20
+ temperature=0.1, # 直接指定
21
+ repetition_penalty=1.2, # 直接指定
22
+ top_p=0.9, # 可选参数
23
+ # 其他参数也可以直接在这里指定
 
24
  )
25
 
26
  # 2. 创建ReAct代理