Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,8 +5,11 @@ from PIL import Image
|
|
5 |
import base64
|
6 |
import io
|
7 |
|
8 |
-
|
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()
|