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

关于o1系列模型无法正常请求的修复,多模型轮询KeyError: 'finish_reason'的修复 #1992

Merged
merged 5 commits into from
Oct 15, 2024

Conversation

Nextstrain9000
Copy link
Contributor

@Nextstrain9000 Nextstrain9000 commented Oct 5, 2024

  1. o1系列模型报错
[Local Message] 异常

Traceback (most recent call last):
  File "./request_llms/bridge_chatgpt.py", line 309, in predict
    chunk = next(stream_response)
            ^^^^^^^^^^^^^^^^^^^^^
StopIteration

 

{"error":{"message":"Unsupported value: 'messages[0].role' does not support 'system' with this model. (request id: 20241006021047158122252x5u9CiOK) (request id: 20241006021046756787320RpfKToW4)","type":"invalid_request_error","param":"messages[0].role","code":"unsupported_value"}}

0$5UUB)FBE HLAG6I91M4K1

在pr中修复了此问题

($QXCMSZAD2L ~SK(~B{Z3A

  1. 多模型轮询KeyError: 'finish_reason'的问题
Traceback (most recent call last):
  File "./request_llms/bridge_all.py", line 1153, in decorated
    return f(inputs, llm_kwargs, history, sys_prompt, observe_window, console_slience)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "./request_llms/bridge_chatgpt.py", line 205, in predict_no_ui_long_connection
    if json_data and json_data['finish_reason'] == 'content_filter':
                     ~~~~~~~~~^^^^^^^^^^^^^^^^^
KeyError: 'finish_reason'

image

@hongyi-zhao
Copy link
Collaborator

对接one-api的情况下,也可以吗?

@Nextstrain9000
Copy link
Contributor Author

对接one-api的情况下,也可以吗?

仅修改了o1-mini和o1-preview两个模型,one-api的话应该要单独修改

@hongyi-zhao
Copy link
Collaborator

hongyi-zhao commented Oct 6, 2024

对接one-api的情况下,也可以吗?

仅修改了o1-mini和o1-preview两个模型,one-api的话应该要单独修改

在兼容one-api的模式中,仅仅修改config.py,添加相应model即可,其他地方并不需要修改。

另外,我注意到 @binary-husky 已经提交过支持o1的issue了,难道这个没有解决问题?

@Nextstrain9000 Nextstrain9000 changed the title 关于o1系列模型无法正常请求的修复 关于o1系列模型无法正常请求的修复,多模型轮询KeyError: 'finish_reason'的修复 Oct 6, 2024
@Nextstrain9000
Copy link
Contributor Author

对接one-api的情况下,也可以吗?

仅修改了o1-mini和o1-preview两个模型,one-api的话应该要单独修改

在兼容one-api的模式中,仅仅修改 config.py,添加相应模型即可,其他地方并不需要修改。

另外,我注意到 @binary-husky 已经提交过支持o1的issue了,难道这个没有解决问题?

我没有官key,这个是azure的o1 无法调用,对接one-api的情况下我试了也无法正常使用,会一样报错如下。除非是逆向的渠道可以用。


[Local Message] 异常

Traceback (most recent call last):
  File "./request_llms/bridge_chatgpt.py", line 309, in predict
    chunk = next(stream_response)
            ^^^^^^^^^^^^^^^^^^^^^
StopIteration

 

{"error":{"message":"Unsupported value: 'messages[0].role' does not support 'system' with this model. (request id: 2024100614170743539768T3CzpJnL) (request id: 202410061417064580816544nIkzooH)","type":"invalid_request_error","param":"messages[0].role","code":"unsupported_value"}}

image

@hongyi-zhao
Copy link
Collaborator

hongyi-zhao commented Oct 6, 2024

我也有类似的迷惑:官方似乎比逆向还难兼容。

@Nextstrain9000
Copy link
Contributor Author

修改后可调用o1系列模型
G0O I$Y2K1`I79MRMK6RC2P

@binary-husky binary-husky merged commit b8e8457 into binary-husky:master Oct 15, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

3 participants