Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
import random
|
|
|
|
|
4 |
import torch
|
5 |
from diffusers import DiffusionPipeline
|
6 |
-
import spaces
|
7 |
|
8 |
# Basic settings
|
9 |
dtype = torch.bfloat16
|
@@ -70,7 +71,7 @@ KNOWLEDGE
|
|
70 |
- Bottom navigation bar (home, transfers, profile)"""
|
71 |
],
|
72 |
"Infographic": [
|
73 |
-
"""A sophisticated flat-style infographic for a multinational corporation
|
74 |
- Title: "Global Renewable Energy Trends 2025"
|
75 |
- Subtitle: "Market Share and Growth Analysis"
|
76 |
- Visual Elements:
|
@@ -184,7 +185,7 @@ with gr.Blocks(css=css, title="Workflow Canvas") as demo:
|
|
184 |
|
185 |
with gr.Row():
|
186 |
# Left sidebar: Common generation parameters
|
187 |
-
with gr.
|
188 |
gr.Markdown("### Generation Parameters")
|
189 |
seed_slider = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=42)
|
190 |
randomize_seed = gr.Checkbox(label="Randomize Seed", value=True)
|
@@ -326,4 +327,4 @@ if __name__ == "__main__":
|
|
326 |
share=False,
|
327 |
show_error=True,
|
328 |
debug=True
|
329 |
-
)
|
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
import random
|
4 |
+
# Import spaces BEFORE torch and diffusers to avoid CUDA initialization error
|
5 |
+
import spaces
|
6 |
import torch
|
7 |
from diffusers import DiffusionPipeline
|
|
|
8 |
|
9 |
# Basic settings
|
10 |
dtype = torch.bfloat16
|
|
|
71 |
- Bottom navigation bar (home, transfers, profile)"""
|
72 |
],
|
73 |
"Infographic": [
|
74 |
+
"""A sophisticated flat-style infographic for a multinational corporation's annual report:
|
75 |
- Title: "Global Renewable Energy Trends 2025"
|
76 |
- Subtitle: "Market Share and Growth Analysis"
|
77 |
- Visual Elements:
|
|
|
185 |
|
186 |
with gr.Row():
|
187 |
# Left sidebar: Common generation parameters
|
188 |
+
with gr.Column(scale=2, elem_classes="sidebar"):
|
189 |
gr.Markdown("### Generation Parameters")
|
190 |
seed_slider = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=42)
|
191 |
randomize_seed = gr.Checkbox(label="Randomize Seed", value=True)
|
|
|
327 |
share=False,
|
328 |
show_error=True,
|
329 |
debug=True
|
330 |
+
)
|