JUNGU commited on
Commit
2775582
โ€ข
1 Parent(s): 52e7b1a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -5,8 +5,11 @@ from PIL import Image
5
  import base64
6
  import io
7
 
8
- client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY")
9
-
 
 
 
10
 
11
  def image_to_base64(image):
12
  buffered = io.BytesIO()
 
5
  import base64
6
  import io
7
 
8
+ # OpenAI ํด๋ผ์ด์–ธํŠธ๋ฅผ API ํ‚ค๋กœ ์ดˆ๊ธฐํ™”
9
+ api_key = os.getenv("OPENAI_API_KEY")
10
+ if api_key is None:
11
+ raise ValueError("OPENAI_API_KEY ํ™˜๊ฒฝ ๋ณ€์ˆ˜๊ฐ€ ์„ค์ •๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.")
12
+ client = openai.OpenAI(api_key=api_key)
13
 
14
  def image_to_base64(image):
15
  buffered = io.BytesIO()