copilot-coder / agent-demo-01

0 stars 0 forks source link

OpenAI配置qwen本地大模型api接口,出现了相关错误 #1

Closed nuocheng closed 2 months ago

nuocheng commented 3 months ago

你好,我在运行你的代码时,出现了如下错误: openai.BadRequestError: Error code: 400 - {'object': 'error', 'message': "[{'type': 'extra_forbidden', 'loc': ('body', 'tools'), 'msg': 'Extra inputs are not permitted', 'input': [{'type': 'function', 'function': {'name': 'get_current_weather', 'description': '获取当前地区的天气', 'parameters': {'type': 'object', 'properties': {'location': {'type': 'string', 'description': 'The city and state, e.g. San Francisco, CA'}}, 'required': ['location']}}}]}]", 'type': 'BadRequestError', 'param': None, 'code': 400} 请问你遇到过这个问题吗

nuocheng commented 3 months ago

这个问题解决了,可能是模型的问题 但是现在又出现,没有去调用工具这个方法 image

copilot-coder commented 3 months ago

是通过ollama去跑本地的qwen吗?

nuocheng commented 2 months ago

使用的是vllm去部署的大模型,然后用的openai开启的api

是通过ollama去跑本地的qwen吗?

copilot-coder commented 2 months ago

你用的qwen的模型参数量是多少B的?有没有试过llama3或者qwen2,或者换个参数量大些的qwen

nuocheng commented 2 months ago

使用的是qwen1.5-14b的模型,目前没有试过更大的模型 是模型不支持吗?

copilot-coder commented 2 months ago

vLLM不支持tools定义:https://docs.vllm.ai/en/stable/serving/openai_compatible_server.html 可以用Deprecated的function_call字段定义:https://platform.openai.com/docs/api-reference/chat/create https://mp.weixin.qq.com/s/ugsBImLloNIbbrAbwu06uw 这篇文章有Deprecated的function_call例子

nuocheng commented 2 months ago

好的,感谢