Skip to content
This repository has been archived by the owner on Jan 27, 2024. It is now read-only.

RetryError state=finished raised AttributeError #50

Open
ggyy1314 opened this issue Nov 7, 2023 · 1 comment
Open

RetryError state=finished raised AttributeError #50

ggyy1314 opened this issue Nov 7, 2023 · 1 comment

Comments

@ggyy1314
Copy link

ggyy1314 commented Nov 7, 2023

前一兩個月還可以使用,今天突然不能使用了。
顯示一連串類似這樣的信息。

Translating paragraphs: 78% 143/183 [03:44<00:41, 1.04s/paragraph]An error occurred during translation: RetryError[<Future at 0x7b3a1c73b670 state=finished raised AttributeError>]

我上網也找不到原因,
我猜想會是跟 openai 版本的更新有關係嗎?
0.28.1 升級到 1.1.1 然後
AttributeError: module ‘openai’ has no attribute ‘ChatCompletion’"

python 3.10.12


請問這個有幫助嗎?
https://platform.openai.com/examples/default-translation

# This code is for v1 of the openai package: pypi.org/project/openai
from openai import OpenAI
client = OpenAI()

response = client.chat.completions.create(
  model="gpt-4",
  messages=[],
  temperature=0,
  max_tokens=256
)
@YuxuanXiu
Copy link

主要是因为OpenAI更新了Python API~
我对ChatGPT-for-Translation中的API进行了更新,修改后的代码在这里:
https://github.com/YuxuanXiu/ChatGPT-for-Translation-with-Updated-API
亲测可用。

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

No branches or pull requests

2 participants