QinOwen
commited on
Commit
•
2846498
1
Parent(s):
a9bbd0d
example-lazy
Browse files
app.py
CHANGED
@@ -60,7 +60,7 @@ def update_dropdown(lora_rank):
|
|
60 |
else: # 0
|
61 |
return gr.update(value="Base Model")
|
62 |
|
63 |
-
@spaces.GPU(duration=
|
64 |
def setup_model_progress(lora_model, lora_rank):
|
65 |
global model
|
66 |
|
@@ -72,7 +72,7 @@ def setup_model_progress(lora_model, lora_rank):
|
|
72 |
# Enable buttons after loading and update indicator
|
73 |
yield (gr.update(interactive=True), gr.update(interactive=True), gr.update(interactive=True), "Model loaded successfully")
|
74 |
|
75 |
-
@spaces.GPU(duration=
|
76 |
def generate_example(prompt, lora_model, lora_rank, seed, height, width, unconditional_guidance_scale, ddim_steps, ddim_eta,
|
77 |
frames, savefps):
|
78 |
global model
|
@@ -267,7 +267,7 @@ with gr.Blocks(css=custom_css) as demo:
|
|
267 |
outputs=output_video,
|
268 |
fn=generate_example,
|
269 |
run_on_click=False,
|
270 |
-
cache_examples=
|
271 |
)
|
272 |
|
273 |
demo.launch(share=True)
|
|
|
60 |
else: # 0
|
61 |
return gr.update(value="Base Model")
|
62 |
|
63 |
+
@spaces.GPU(duration=180)
|
64 |
def setup_model_progress(lora_model, lora_rank):
|
65 |
global model
|
66 |
|
|
|
72 |
# Enable buttons after loading and update indicator
|
73 |
yield (gr.update(interactive=True), gr.update(interactive=True), gr.update(interactive=True), "Model loaded successfully")
|
74 |
|
75 |
+
@spaces.GPU(duration=300)
|
76 |
def generate_example(prompt, lora_model, lora_rank, seed, height, width, unconditional_guidance_scale, ddim_steps, ddim_eta,
|
77 |
frames, savefps):
|
78 |
global model
|
|
|
267 |
outputs=output_video,
|
268 |
fn=generate_example,
|
269 |
run_on_click=False,
|
270 |
+
cache_examples="lazy",
|
271 |
)
|
272 |
|
273 |
demo.launch(share=True)
|