Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -43,25 +43,16 @@ def generate_image(prompt, max_retries=5):
|
|
43 |
# This line should never be reached, but just in case:
|
44 |
return None, "Unexpected error occurred"
|
45 |
|
46 |
-
|
47 |
-
|
48 |
-
gr.
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
with gr.Column(scale=1):
|
58 |
-
file_explorer = gr.FileExplorer(label="File System")
|
59 |
-
|
60 |
-
generate_btn.click(
|
61 |
-
generate_image,
|
62 |
-
inputs=input_text,
|
63 |
-
outputs=[image_output, info_output]
|
64 |
-
)
|
65 |
|
66 |
logger.info("Launching the Gradio interface...")
|
67 |
-
|
|
|
43 |
# This line should never be reached, but just in case:
|
44 |
return None, "Unexpected error occurred"
|
45 |
|
46 |
+
iface = gr.Interface(
|
47 |
+
fn=generate_image,
|
48 |
+
inputs=gr.Textbox(label="Enter your prompt"),
|
49 |
+
outputs=[
|
50 |
+
gr.Image(label="Generated Image"),
|
51 |
+
gr.Textbox(label="Output Information", lines=5)
|
52 |
+
],
|
53 |
+
title="Text-to-Image Generation",
|
54 |
+
description="Enter a prompt to generate an image. The system will automatically retry up to 5 times if an error occurs."
|
55 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
|
57 |
logger.info("Launching the Gradio interface...")
|
58 |
+
iface.launch()
|