Spaces:
Runtime error
Runtime error
bonosa
commited on
Commit
·
20202fe
1
Parent(s):
3fe9359
v 1.0
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import urllib.request
|
|
4 |
from PIL import Image
|
5 |
import os
|
6 |
import nltk
|
7 |
-
nltk.download('punkt')
|
8 |
openai.api_key = os.environ['key1']
|
9 |
|
10 |
def generate_image(prompt):
|
@@ -26,9 +26,17 @@ def generate_image(prompt):
|
|
26 |
|
27 |
iface = gr.Interface(
|
28 |
fn=generate_image,
|
29 |
-
inputs=
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
examples=["a macaw in a hat sitting on a bench in a park"]
|
32 |
)
|
|
|
|
|
33 |
|
34 |
iface.launch()
|
|
|
4 |
from PIL import Image
|
5 |
import os
|
6 |
import nltk
|
7 |
+
#nltk.download('punkt')
|
8 |
openai.api_key = os.environ['key1']
|
9 |
|
10 |
def generate_image(prompt):
|
|
|
26 |
|
27 |
iface = gr.Interface(
|
28 |
fn=generate_image,
|
29 |
+
inputs=[
|
30 |
+
gr.inputs.Textbox(lines=1, label="API Key", type="password"),
|
31 |
+
gr.inputs.Textbox(lines=1, label="Prompt")
|
32 |
+
],
|
33 |
+
outputs=gr.outputs.Image(type="pil"),
|
34 |
+
title="DALL-E Image Generator",
|
35 |
+
description="Enter your API key and a prompt to generate an image from DALL-E."
|
36 |
+
|
37 |
examples=["a macaw in a hat sitting on a bench in a park"]
|
38 |
)
|
39 |
+
|
40 |
+
)
|
41 |
|
42 |
iface.launch()
|