JUNGU commited on
Commit
52e7b1a
1 Parent(s): 109854c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,12 +1,12 @@
1
  import gradio as gr
2
- import openai
3
  import os
4
  from PIL import Image
5
  import base64
6
  import io
7
 
8
- # Ensure you have your OpenAI API key set as an environment variable
9
- openai.api_key = os.getenv("OPENAI_API_KEY")
10
 
11
  def image_to_base64(image):
12
  buffered = io.BytesIO()
 
1
  import gradio as gr
2
+ from openai import OpenAI
3
  import os
4
  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()