Spaces:
Runtime error
Runtime error
Commit
·
3b21992
1
Parent(s):
6e090d9
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,14 +23,25 @@ def process_prompt(prompt):
|
|
| 23 |
image_return = model(prompt)
|
| 24 |
return image_return
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
image_return = model(prompt)
|
| 24 |
return image_return
|
| 25 |
|
| 26 |
+
# Define the Gradio interface
|
| 27 |
+
prompt_input = Textbox("Enter a prompt", lines=3)
|
| 28 |
+
text_output = Label("")
|
| 29 |
+
image_output = Image()
|
| 30 |
+
|
| 31 |
+
iface = gr.Interface(
|
| 32 |
+
generate_image,
|
| 33 |
+
inputs=prompt_input,
|
| 34 |
+
outputs=[text_output, image_output],
|
| 35 |
+
title="Image Generator",
|
| 36 |
+
description="Generates an image based on a prompt using OpenAI's GPT-3 and DALL-E models."
|
| 37 |
+
)
|
| 38 |
+
|
| 39 |
+
# Update the output boxes with the generated text and image
|
| 40 |
+
def update_text_output(text, image_url):
|
| 41 |
+
text_output.text = text
|
| 42 |
+
text_output.style['font-size'] = '8px' # Change the font size here
|
| 43 |
+
|
| 44 |
+
iface.interface_result_hooks = [update_text_output]
|
| 45 |
+
|
| 46 |
+
# Launch the interface
|
| 47 |
+
iface.launch()
|