baidubce / bce-qianfan-sdk

Provide best practices for LMOps, as well as elegant and convenient access to the features of the Qianfan MaaS Platform. (提供大模型工具链最佳实践,以及优雅且便捷地访问千帆大模型平台)
https://cloud.baidu.com/doc/WENXINWORKSHOP/index.html
Apache License 2.0
334 stars 51 forks source link

Python SDK 不支持 ernie-4.0-turbo-8k-preview、ernie-4.0-turbo-8k-latest #834

Closed LogCreative closed 1 month ago

LogCreative commented 1 month ago

System Info

qianfan version

System Version

Reproduction

使用 Python SDK 运行官网文档代码 https://cloud.baidu.com/doc/WENXINWORKSHOP/s/flxwku3ea

import os
import qianfan

# 通过环境变量初始化认证信息
# 方式一:【推荐】使用安全认证AK/SK鉴权
# 替换下列示例中参数,安全认证Access Key替换your_iam_ak,Secret Key替换your_iam_sk,如何获取请查看https://cloud.baidu.com/doc/Reference/s/9jwvz2egb
os.environ["QIANFAN_ACCESS_KEY"] = "your_iam_ak"
os.environ["QIANFAN_SECRET_KEY"] = "your_iam_sk"

# 方式二:【不推荐】使用应用AK/SK鉴权
# 替换下列示例中参数,将应用API_Key、应用Secret key值替换为真实值
#os.environ["QIANFAN_AK"] = "应用API_Key"
#os.environ["QIANFAN_SK"] = "应用Secret_Key"

chat_comp = qianfan.ChatCompletion()

# 指定特定模型
resp = chat_comp.do(model="ERNIE-4.0-Turbo-8K-Preview", messages=[{
    "role": "user",
    "content": "你好"
}])

print(resp["body"])

结果显示模型不支持,请问是否有计划支持该模型

qianfan.errors.InvalidArgumentError: The provided model `ERNIE-4.0-Turbo-8K-Preview` is not in the list of supported models. If this is a recently added model, try using the `endpoint` arguments and create an issue to tell us. Supported models: dict_keys(['ERNIE-4.0-8K-Latest', 'ERNIE-4.0-8K-0613', 'ERNIE-4.0-Turbo-8K', 'ERNIE-Lite-AppBuilder-8K-0614', 'ERNIE-3.5-8K-0701', 'ERNIE-3.5-8K-0613', 'ERNIE-Lite-Pro-8K', 'ERNIE-Lite-8K-0922', 'ERNIE-Lite-8K-0308', 'ERNIE-Lite-V', 'ERNIE-3.5-8K', 'ERNIE-4.0-8K', 'ERNIE-4.0-8K-0329', 'ERNIE-4.0-8K-0104', 'ERNIE-4.0-8K-Preview-0518', 'ERNIE-4.0-8K-preview', 'ERNIE-3.5-128K', 'ERNIE-3.5-8K-preview', 'ERNIE-3.5-8K-0205', 'ERNIE-3.5-8K-0329', 'ERNIE-Speed-Pro-8K', 'ERNIE-Speed-8K', 'ERNIE-Speed-Pro-128K', 'ERNIE-Speed-128K', 'ERNIE Speed-AppBuilder', 'ERNIE-Tiny-8K', 'ERNIE-Novel-8K', 'ERNIE-Function-8K', 'Qianfan-Dynamic-8K', 'ERNIE-Character-8K', 'ERNIE-Character-Fiction-8K', 'BLOOMZ-7B', 'Llama-2-7B-Chat', 'Llama-2-13B-Chat', 'Llama-2-70B-Chat', 'Meta-Llama-3-8B', 'Meta-Llama-3-70B', 'Qianfan-BLOOMZ-7B-compressed', 'Qianfan-Chinese-Llama-2-7B', 'ChatGLM2-6B-32K', 'AquilaChat-7B', 'XuanYuan-70B-Chat-4bit', 'Qianfan-Chinese-Llama-2-13B', 'Qianfan-Chinese-Llama-2-70B', 'ChatLaw', 'Yi-34B-Chat', 'Mixtral-8x7B-Instruct', 'Gemma-7B-it', 'UNSPECIFIED_MODEL', 'ERNIE-Speed', 'ERNIE Speed', 'ERNIE 3.5', 'ERNIE-Lite-8K', 'ERNIE-4.0-preview', 'ERNIE-3.5-preview', 'ERNIE-Functions-8K', 'ERNIE-Bot-4', 'ERNIE-Bot', 'ERNIE-Bot-turbo', 'EB-turbo-AppBuilder', 'ERNIE-Bot-turbo-AI']) 
Dobiichi-Origami commented 1 month ago

感谢关注,如目前无法使用的模型可以使用 endpoint 进行调用。该校验仅基于代码中默认模型列表进行检查,后续我们会更新该校验列表