Skip to content
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

Max retries reached #316

Open
v-yunbin opened this issue Feb 29, 2024 · 6 comments
Open

Max retries reached #316

v-yunbin opened this issue Feb 29, 2024 · 6 comments
Assignees
Labels
llm issues about llm usage

Comments

@v-yunbin
Copy link

v-yunbin commented Feb 29, 2024

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
@mushenL
Copy link
Collaborator

mushenL commented Feb 29, 2024

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

@v-yunbin
Copy link
Author

v-yunbin commented Mar 1, 2024

您好,新版本暂时没有适配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

@mushenL
Copy link
Collaborator

mushenL commented Mar 1, 2024

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

@v-yunbin
Copy link
Author

v-yunbin commented Mar 5, 2024

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

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

@mushenL
Copy link
Collaborator

mushenL commented Mar 6, 2024

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

@zzhangpurdue
Copy link
Collaborator

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 zzhangpurdue added the llm issues about llm usage label Mar 12, 2024
@zzhangpurdue zzhangpurdue self-assigned this Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
llm issues about llm usage
Projects
None yet
Development

No branches or pull requests

3 participants