Skip to content

Commit

Permalink
Fix #544: upgrade openai library from version 0.28 to version 1.x.
Browse files Browse the repository at this point in the history
  • Loading branch information
bmerkle committed Jul 31, 2024
1 parent 961f555 commit b7c53cf
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 17 deletions.
4 changes: 2 additions & 2 deletions 09-building-image-applications/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ So what does it take to build an image generation application? You need the foll
image.show()
# catch exceptions
except openai.error.InvalidRequestError as err:
except openai.InvalidRequestError as err:
print(err)
```
Expand Down Expand Up @@ -454,7 +454,7 @@ try:
image.show()
# catch exceptions
except openai.error.InvalidRequestError as err:
except openai.InvalidRequestError as err:
print(err)
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
# Display the image in the default image viewer
image = Image.open(image_path)
image.show()
#except openai.error.InvalidRequestError as err:
#except openai.InvalidRequestError as err:
# print(err)

finally:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
" image.show()\n",
" \n",
" # catch exceptions\n",
" except openai.error.InvalidRequestError as err:\n",
" except openai.InvalidRequestError as err:\n",
" print(err)\n",
"\n",
" ```\n",
Expand Down
2 changes: 1 addition & 1 deletion 09-building-image-applications/python/oai-app-variation.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
# Display the image in the default image viewer
image = Image.open(image_path)
image.show()
except openai.error.InvalidRequestError as err:
except openai.InvalidRequestError as err:
print(err)
3 changes: 1 addition & 2 deletions 09-building-image-applications/python/oai-app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

# import dotenv
dotenv.load_dotenv()


client = OpenAI()

Expand Down Expand Up @@ -42,7 +41,7 @@
image.show()

# catch exceptions
except client.error.InvalidRequestError as err:
except openai.InvalidRequestError as err:
print(err)

# ---creating variation below---
Expand Down
4 changes: 2 additions & 2 deletions 09-building-image-applications/translations/cn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ _图片来源维基百科,图片由 Midjourney 生成_
image.show()
# catch exceptions
except openai.error.InvalidRequestError as err:
except openai.InvalidRequestError as err:
print(err)
```
Expand Down Expand Up @@ -458,7 +458,7 @@ try:
image.show()
# catch exceptions
except openai.error.InvalidRequestError as err:
except openai.InvalidRequestError as err:
print(err)
```
Expand Down
4 changes: 2 additions & 2 deletions 09-building-image-applications/translations/ja-jp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ _Image cred Wikipedia, image generated by Midjourney_
image.show()
# 例外をキャッチ
except openai.error.InvalidRequestError as err:
except openai.InvalidRequestError as err:
print(err)
```
Expand Down Expand Up @@ -454,7 +454,7 @@ try:
image.show()
# 例外をキャッチ
except openai.error.InvalidRequestError as err:
except openai.InvalidRequestError as err:
print(err)
```
Expand Down
4 changes: 2 additions & 2 deletions 09-building-image-applications/translations/ko/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ _자기회귀 트랜스포머 (autoregressive transformer)_ 는 모델이 텍스
image.show()
# 예외 처리
except openai.error.InvalidRequestError as err:
except openai.InvalidRequestError as err:
print(err)
```
Expand Down Expand Up @@ -446,7 +446,7 @@ try:
image.show()
# 예외 처리
except openai.error.InvalidRequestError as err:
except openai.InvalidRequestError as err:
print(err)
```
Expand Down
4 changes: 2 additions & 2 deletions 09-building-image-applications/translations/pt-br/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Então, o que é necessário para construir um aplicativo de geração de imagen
image.show()
# catch exceptions
except openai.error.InvalidRequestError as err:
except openai.InvalidRequestError as err:
print(err)
```
Expand Down Expand Up @@ -493,7 +493,7 @@ try:
image.show()
# catch exceptions
except openai.error.InvalidRequestError as err:
except openai.InvalidRequestError as err:
print(err)
```
Expand Down
4 changes: 2 additions & 2 deletions 09-building-image-applications/translations/tw/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ _圖片來源 Wikipedia, 圖片由 Midjourney 生成_
image.show()
# 捕捉異常
except openai.error.InvalidRequestError as err:
except openai.InvalidRequestError as err:
print(err)
```
Expand Down Expand Up @@ -454,7 +454,7 @@ try:
image.show()
# 捕捉異常
except openai.error.InvalidRequestError as err:
except openai.InvalidRequestError as err:
print(err)
```
Expand Down

0 comments on commit b7c53cf

Please sign in to comment.