Spaces:
Runtime error
Runtime error
Update app.py
#8
by
Aditibaheti
- opened
app.py
CHANGED
|
@@ -23,8 +23,8 @@ pipeline = DiffusionPipeline.from_pretrained(
|
|
| 23 |
use_auth_token=HUGGINGFACE_TOKEN
|
| 24 |
)
|
| 25 |
pipeline.load_lora_weights(lora_weights_path)
|
| 26 |
-
|
| 27 |
-
|
| 28 |
pipeline = pipeline.to(device)
|
| 29 |
|
| 30 |
MAX_SEED = np.iinfo(np.int32).max
|
|
@@ -140,7 +140,9 @@ with gr.Blocks(css=css) as demo:
|
|
| 140 |
|
| 141 |
gr.Examples(
|
| 142 |
examples=examples,
|
| 143 |
-
inputs=[prompt]
|
|
|
|
|
|
|
| 144 |
)
|
| 145 |
|
| 146 |
run_button.click(
|
|
@@ -149,4 +151,4 @@ with gr.Blocks(css=css) as demo:
|
|
| 149 |
outputs=[result]
|
| 150 |
)
|
| 151 |
|
| 152 |
-
demo.queue().launch()
|
|
|
|
| 23 |
use_auth_token=HUGGINGFACE_TOKEN
|
| 24 |
)
|
| 25 |
pipeline.load_lora_weights(lora_weights_path)
|
| 26 |
+
pipeline.enable_sequential_cpu_offload() # Efficient memory usage
|
| 27 |
+
pipeline.enable_xformers_memory_efficient_attention() # Enable xformers memory efficient attention
|
| 28 |
pipeline = pipeline.to(device)
|
| 29 |
|
| 30 |
MAX_SEED = np.iinfo(np.int32).max
|
|
|
|
| 140 |
|
| 141 |
gr.Examples(
|
| 142 |
examples=examples,
|
| 143 |
+
inputs=[prompt],
|
| 144 |
+
fn=None,
|
| 145 |
+
outputs=None
|
| 146 |
)
|
| 147 |
|
| 148 |
run_button.click(
|
|
|
|
| 151 |
outputs=[result]
|
| 152 |
)
|
| 153 |
|
| 154 |
+
demo.queue().launch()
|