-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
本地部署时,执行tool出错 #325
Comments
您好,从您的报错信息上来看,应该是是您这边没有在环境变量上设置相应的api_token,您可以设置MODELSCOPE_API_TOKEN这个环境变量,关于每个tool中所使用的api_token在readme.md上都有说明,您可以参考,至于您说的本地调用tool,您可以参考本地部署模型服务的方式,将tool所使用的模型在您本地部署成服务,然后将配置文件里面的url改为您的服务接口即可,如果您需要本地直接加载,modelscope_agent/tools/modelscope_tools/pipeline_tool.py 上有开放_local_call接口函数,但是需要您自己适配tool模型 |
如果不采用模型,采用本地tool(exe)或者api函数(dll)等方式,如何接入? |
暂时不支持,可能需要您参考 modelscope_agent/tools/modelscope_tools/pipeline_tool.py 相关的call函数自行适配 |
如果您能把对应的exe或者dll变成服务进行部署,也是可以调用的。 |
本地文生图服务已开启,但修改这个文件modelscope-agent\apps\agentfabric\config\tool_config.json "image_gen": { |
报错信息有么?我们跟进一下。 |
不报错,就是无法调用本地文生图API, |
修改modelscope-agent\apps\agentfabric\config文件增加fooocus_image_gen这个tool,开启fooocus-api(命令行可以正常调用),AgentFabric也无法调用。 "fooocus_image_gen": { 报错: The above exception was the direct cause of the following exception: Traceback (most recent call last): |
for mac. 删除 /tmp目录下的agentfabric文件夹,重新运行下 |
按照此教程配置好环境https://github.com/modelscope/modelscope-agent/blob/master/docs/local_deploy.md,执行时tool如何调用?比如我配置这个“语音生成”的tool,远程调用api,会有如下错误。
错误日志如下
2024-03-06 17:06:43.901 - modelscope-agent - INFO - | message: using builder model qwen1.5-4b-chat | uuid: local_user | details: {} | step: | error:
2024-03-06 17:06:46,909 - modelscope - WARNING - Model revision not specified, use revision: v1.1.0
2024-03-06 17:06:47,418 - modelscope - INFO - initiate model from /mnt/workspace/.cache/modelscope/damo/nlp_gte_sentence-embedding_chinese-base
2024-03-06 17:06:47,418 - modelscope - INFO - initiate model from location /mnt/workspace/.cache/modelscope/damo/nlp_gte_sentence-embedding_chinese-base.
2024-03-06 17:06:47,421 - modelscope - INFO - initialize model from /mnt/workspace/.cache/modelscope/damo/nlp_gte_sentence-embedding_chinese-base
2024-03-06 17:06:48,974 - modelscope - WARNING - No preprocessor field found in cfg.
2024-03-06 17:06:48,974 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file.
2024-03-06 17:06:48,974 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': '/mnt/workspace/.cache/modelscope/damo/nlp_gte_sentence-embedding_chinese-base'}. trying to build by task and model information.
2024-03-06 17:06:49,012 - modelscope - WARNING - No preprocessor field found in cfg.
2024-03-06 17:06:49,012 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file.
2024-03-06 17:06:49,012 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': '/mnt/workspace/.cache/modelscope/damo/nlp_gte_sentence-embedding_chinese-base', 'sequence_length': 128}. trying to build by task and model information.
2024-03-06 17:06:49.122 - modelscope-agent - INFO - | message: using model qwen1.5-4b-chat | uuid: local_user | details: {'model_config': {'type': 'openai', 'model': 'qwen/Qwen1.5-4B-Chat', 'api_base': 'http://localhost:8000/v1', 'is_chat': True, 'is_function_call': False, 'generate_cfg': {'top_p': 0.5, 'stop': 'Observation'}}} | step: | error:
2024-03-06 17:06:49.155 - modelscope-agent - ERROR - | message: | uuid: local_user | details: {'error_traceback': 'Traceback (most recent call last):\n File "/data/work/modelscope-agent/apps/agentfabric/app.py", line 31, in init_user\n user_agent, user_memory = init_user_chatbot_agent(uuid_str)\n File "/data/work/modelscope-agent/apps/agentfabric/user_core.py", line 42, in init_user_chatbot_agent\n agent = RolePlay(\n File "/data/work/modelscope-agent/modelscope_agent/agent.py", line 47, in init\n self._register_tool(function)\n File "/data/work/modelscope-agent/modelscope_agent/agent.py", line 109, in _register_tool\n self.function_map[tool_name] = TOOL_REGISTRYtool_name\n File "/data/work/modelscope-agent/modelscope_agent/tools/modelscope_tools/pipeline_tool.py", line 29, in init\n assert self.api_token is not None, 'api_token is not set'\nAssertionError: api_token is not set\n'} | step: | error: api_token is not set
同时,请问调用本地tool有例程吗?
The text was updated successfully, but these errors were encountered: