Spaces:
Runtime error
Runtime error
mikaelbhai
commited on
Commit
·
e8f2b4e
1
Parent(s):
6336595
Update app.py
Browse files
app.py
CHANGED
@@ -1,22 +1,21 @@
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
import openai
|
|
|
4 |
openai.api_key = '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' # your api key
|
5 |
openai.Model.list()
|
6 |
|
7 |
-
prompt = "joe mama"
|
8 |
def DALLE(user_input):
|
9 |
-
|
10 |
response = prompt
|
11 |
|
12 |
-
|
13 |
DALLE_reply = openai.Image.create(
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
)
|
18 |
-
|
19 |
-
|
20 |
|
21 |
-
iface = gr.Interface(fn=DALLE, inputs
|
22 |
-
iface.launch()
|
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
import openai
|
4 |
+
|
5 |
openai.api_key = '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' # your api key
|
6 |
openai.Model.list()
|
7 |
|
|
|
8 |
def DALLE(user_input):
|
9 |
+
prompt = user_input
|
10 |
response = prompt
|
11 |
|
|
|
12 |
DALLE_reply = openai.Image.create(
|
13 |
+
prompt=prompt,
|
14 |
+
n="2",
|
15 |
+
size="1024x1024"
|
16 |
+
)
|
17 |
+
|
18 |
+
return DALLE_reply
|
19 |
|
20 |
+
iface = gr.Interface(fn=DALLE, inputs="text", outputs="image", title="bhAI")
|
21 |
+
iface.launch()
|