bonosa commited on
Commit
d4853ae
·
1 Parent(s): a92a8ca
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -7,6 +7,9 @@ import nltk
7
  #nltk.download('punkt')
8
 
9
  def generate_image(api_key, prompt):
 
 
 
10
  openai.api_key = api_key
11
  response = openai.Image.create(
12
  prompt=prompt,
 
7
  #nltk.download('punkt')
8
 
9
  def generate_image(api_key, prompt):
10
+ if not api_key:
11
+ raise ValueError("API Key is required.")
12
+
13
  openai.api_key = api_key
14
  response = openai.Image.create(
15
  prompt=prompt,