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

GitHub Models 渠道使用 gpt-4o 模型报错 Resource not found #1901

Open
5 tasks done
tisfeng opened this issue Oct 30, 2024 · 5 comments
Open
5 tasks done

GitHub Models 渠道使用 gpt-4o 模型报错 Resource not found #1901

tisfeng opened this issue Oct 30, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@tisfeng
Copy link
Contributor

tisfeng commented Oct 30, 2024

例行检查

  • 我已确认目前没有类似 issue
  • 我已确认我已升级到最新版本
  • 我已完整查看过项目 README,尤其是常见问题部分
  • 我理解并愿意跟进此 issue,协助测试和提供反馈
  • 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 issue 可能会被无视或直接关闭

问题描述

我添加 GitHub Models 作为 OpenAI 渠道,测试其他模型例如 Llama-3.2-90B-Vision-Instruct 都是成功的,但 gpt-4o,gpt-4o-mini 等模型报错 Resource not found。

我确认我的 GitHub 账号有 gpt-4o 等模型的权限,我正常使用 HTTP 接口运行都没有问题,是否 one-api 对 gpt-4o 等模型有特殊处理,导致异常?

image

复现步骤

预期结果

GitHub Models 渠道能正常使用 gpt-4o 模型。

相关截图

iShot_2024-10-30_18.45.18.mp4
@tisfeng tisfeng added the bug Something isn't working label Oct 30, 2024
@assassinliujie
Copy link

请使用azure openai,而不是openai
图片

@tisfeng
Copy link
Contributor Author

tisfeng commented Oct 31, 2024

为什么要用 azure openai ?我看 GitHub Models 文档显示,这个就是标准的 OpenAI 接口,我直接这样调用是没有问题的。

测试其他模型例如 Llama-3.2-90B-Vision-Instruct 都是成功的,但 gpt-4o,gpt-4o-mini 等模型报错 Resource not found。

我没看代码实现,只是对这一点感到很奇怪。

curl -X POST "https://models.inference.ai.azure.com/chat/completions" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer $GITHUB_TOKEN" \
    -d '{
        "messages": [
            {
                "role": "system",
                "content": ""
            },
            {
                "role": "user",
                "content": "Can you explain the basics of machine learning?"
            }
        ],
        "model": "gpt-4o-mini",
        "temperature": 1,
        "max_tokens": 4096,
        "top_p": 1
    }'

@tisfeng
Copy link
Contributor Author

tisfeng commented Oct 31, 2024

@assassinliujie 假如要改用 azure openai,API 版本填什么?我没看到文档有写这个值。

image

@tisfeng
Copy link
Contributor Author

tisfeng commented Oct 31, 2024

奇怪,我改用 Azure OpenAI,使用默认版本后,gpt-4o 和 gpt-4o-mini 确实可以使用了 😓

就是用 o1-mini 这些模型时也会遇到这问题 #1902

image

@tisfeng
Copy link
Contributor Author

tisfeng commented Oct 31, 2024

看了一下 OpenAI 文档,o1 系列已经改用 max_completion_tokens 替代 max_tokens 了。

This value is now deprecated in favor of max_completion_tokens, and is not compatible with o1 series models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants