@ -25,15 +25,16 @@ for _ in range(10): # 网络不稳定,多试几次
name,device_map="auto",trust_remote_code=True
name,device_map="auto",trust_remote_code=True
).eval()
).eval()
model.generation_config=generation_config
model.generation_config=generation_config
model.generation_config.top_k=1
break
break
exceptException:
exceptExceptionase:
pass
print(e)
# 将一个插件的关键信息拼接成一段文本的模版。
# 将一个插件的关键信息拼接成一段文本的模版。
TOOL_DESC="""{name_for_model}: Call this tool to interact with the {name_for_human} API. What is the {name_for_human} API useful for? {description_for_model} Parameters: {parameters}"""
TOOL_DESC="""{name_for_model}: Call this tool to interact with the {name_for_human} API. What is the {name_for_human} API useful for? {description_for_model} Parameters: {parameters}"""
# ReAct prompting 的 instruction 模版,将包含插件的详细信息。
# ReAct prompting 的 instruction 模版,将包含插件的详细信息。
PROMPT_REACT="""Answer the following questions as best you can. You have access to the following tools:
PROMPT_REACT="""Answer the following questions as best you can. You have access to the following APIs: