ms-agent icon indicating copy to clipboard operation
ms-agent copied to clipboard

Max retries reached

Open zyb8543d opened this issue 1 year ago • 6 comments

codes:

@register_tool('RenewInstance')
class AliyunRenewInstanceTool(BaseTool):
    description = '续费一台包年包月ECS实例'
    name = 'RenewInstance'
    parameters: list = [{
        'name': 'instance_id',
        'description': 'ECS实例ID',
        'required': True,
        'type': 'string'
    }, {
        'name': 'period',
        'description': '续费时长以月为单位',
        'required': True,
        'type': 'string'
    }]

    def call(self, params: str, **kwargs):
        params = self._verify_args(params)
        instance_id = params['instance_id']
        period = params['period']
        return str({'result': f'已完成ECS实例ID为{instance_id}的续费,续费时长{period}月'})


role_template = '你扮演一名ECS实例管理员,你需要根据用户的要求来满足他们'
llm_config = {
    'model': '/data/disk2/ybZhang/Chinese-LLM-Chat/models/qwen-7b-chat',
    'model_server': 'modelscope',
    }
function_list = ['RenewInstance']

bot = RolePlay(function_list=function_list,llm=llm_config, instruction=role_template)
response = bot.run("请帮我续费一台ECS实例,实例id是:i-rj90a7e840y5cde,续费时长10个月", remote=False, print_info=True)
text = ''
for chunk in response:
    text += chunk
print(text)

Error:

2024-02-29 11:30:34.317 - modelscope-agent - WARNING -  | message: Attempt to run chat_with_functions 1 failed:
2024-02-29 11:30:34.819 - modelscope-agent - WARNING -  | message: Attempt to run chat_with_functions 2 failed:
2024-02-29 11:30:35.320 - modelscope-agent - WARNING -  | message: Attempt to run chat_with_functions 3 failed:
2024-02-29 11:30:35.825 - modelscope-agent - ERROR -  | message: Traceback (most recent call last):
  File "/data/disk2/ybZhang/modelscope-agent/modelscope_agent/llm/base.py", line 192, in support_function_calling
    response = self.chat_with_functions(
  File "/data/disk2/ybZhang/modelscope-agent/modelscope_agent/utils/retry.py", line 38, in wrapper
    raise Exception('Max retries reached. Failed to get result')
Exception: Max retries reached. Failed to get result

2024-02-29 11:30:35.826 - modelscope-agent - WARNING -  | message: Attempt to run chat 1 failed:
2024-02-29 11:30:36.327 - modelscope-agent - WARNING -  | message: Attempt to run chat 2 failed:
2024-02-29 11:30:36.8

zyb8543d avatar Feb 29 '24 03:02 zyb8543d

您好,新版本暂时没有适配modelscope的model_serve,所以按照直接使用本地模型路径的话会有报错,现阶段推荐使用demo中所用的远程模型调用,如果本地部署的话建议使用https://github.com/modelscope/modelscope-agent/blob/master/docs/local_deploy.md文档所描述的部署方案进行部署,

mushenL avatar Feb 29 '24 09:02 mushenL

您好,新版本暂时没有适配modelscope的model_serve,所以按照直接使用本地模型路径的话会有报错,现阶段推荐使用demo中所用的远程模型调用,如果本地部署的话建议使用https://github.com/modelscope/modelscope-agent/blob/master/docs/local_deploy.md文档所描述的部署方案进行部署,

@mushenL 你好,这个文档不存在:https://github.com/modelscope/modelscope-agent/blob/master/docs/local_deploy.md

zyb8543d avatar Mar 01 '24 10:03 zyb8543d

image 您好,我这边看是文档是存在的,可以检查一下分支是否正确 https://github.com/modelscope/modelscope-agent/blob/master/docs/local_deploy.md

mushenL avatar Mar 01 '24 10:03 mushenL

image 您好,我这边看是文档是存在的,可以检查一下分支是否正确 https://github.com/modelscope/modelscope-agent/blob/master/docs/local_deploy.md

后续会支持加载本地模型吗?

zyb8543d avatar Mar 05 '24 08:03 zyb8543d

本地模型调用现在只支持通过部署服务的方式,直接加载本地模型由于缺点很多,后期没有特殊需求不会支持了

mushenL avatar Mar 06 '24 07:03 mushenL

image 您好,我这边看是文档是存在的,可以检查一下分支是否正确 https://github.com/modelscope/modelscope-agent/blob/master/docs/local_deploy.md

后续会支持加载本地模型吗? 本地模型可以通过vllm 的方式拉起, 参考:https://github.com/modelscope/modelscope-agent/blob/master/docs/local_deploy.md

zzhangpurdue avatar Mar 12 '24 11:03 zzhangpurdue