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

输入长度过长 #1

Open
dhx20150812 opened this issue Jul 14, 2024 · 2 comments
Open

输入长度过长 #1

dhx20150812 opened this issue Jul 14, 2024 · 2 comments

Comments

@dhx20150812
Copy link

您好!

这是个非常棒的工作!非常感谢您分享的开源代码。我在复现过程中遇到了一些问题,想向您请教。

在运行代码时,我发现在使用LLM根据工具的描述生成功能介绍时,输入文本的长度超出了gpt-3.5-turbo-16k的最大长度限制。有些样例的输入甚至达到了23000个token。我怀疑可能是因为整个工具的内容都被用在了输入中了:user = user.replace("{api_doc}", str(self.api_doc))。针对这个问题,想请问您是如何处理的?

def fetch_func(self):
    if self.func != "":
        return self.func
    gpt_fact = GPTFactory()
    gpt_fact.set_key(args.openai_key)
    system = FORMAT_TOOL_FUNCTIONARITY_FUNCTION
    user = FORMAT_TOOL_FUNCTIONARITY_USER_FUNCTION
    gpt_fact.set_sys_conv(system)
    user = user.replace("{tool_name}", self.api_dest["name"])
    user = user.replace("{pack_description}", self.api_dest["package_desc"])
    user = user.replace("{tool_description}", self.api_dest["desc"])
    user = user.replace("{api_doc}", str(self.api_doc))
    gpt_fact.add_user_conv(user)
    self.func = gpt_fact.predict()
    return self.func

另外,是否可以将这一步处理好的文件tool_library.json上传,方便大家复现您的工作?

非常感谢您的帮助!

祝好!

@OceannTwT
Copy link
Owner

你能提供更多发生错误的case信息吗,我这边运行的时候没发生问题
我复现一下你的case帮你排查一下

@OceannTwT
Copy link
Owner

tool_library.json 有不同的cluster size,文件比较大,不同的setting我们整理好后放出来

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants