Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,9 +6,6 @@ import torch
|
|
| 6 |
from diffusers import DiffusionPipeline, FlowMatchEulerDiscreteScheduler
|
| 7 |
from PIL import Image
|
| 8 |
import io
|
| 9 |
-
import os
|
| 10 |
-
import subprocess
|
| 11 |
-
subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
|
| 12 |
|
| 13 |
dtype = torch.bfloat16
|
| 14 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
@@ -191,24 +188,6 @@ with gr.Blocks(css=css, theme=gr.themes.Soft(primary_hue="blue", secondary_hue="
|
|
| 191 |
cache_examples="lazy"
|
| 192 |
)
|
| 193 |
|
| 194 |
-
share_buttons = gr.Row()
|
| 195 |
-
with share_buttons:
|
| 196 |
-
twitter_button = gr.Button("Share on Twitter")
|
| 197 |
-
facebook_button = gr.Button("Share on Facebook")
|
| 198 |
-
|
| 199 |
-
twitter_button.click(
|
| 200 |
-
fn=lambda img: f"https://twitter.com/intent/tweet?url={img}",
|
| 201 |
-
inputs=[result],
|
| 202 |
-
outputs=None,
|
| 203 |
-
_js="(img) => window.open(img, '_blank')"
|
| 204 |
-
)
|
| 205 |
-
|
| 206 |
-
facebook_button.click(
|
| 207 |
-
fn=lambda img: f"https://www.facebook.com/sharer/sharer.php?u={img}",
|
| 208 |
-
inputs=[result],
|
| 209 |
-
outputs=None,
|
| 210 |
-
_js="(img) => window.open(img, '_blank')"
|
| 211 |
-
)
|
| 212 |
|
| 213 |
gr.on(
|
| 214 |
triggers=[run_button.click, prompt.submit],
|
|
@@ -220,16 +199,7 @@ with gr.Blocks(css=css, theme=gr.themes.Soft(primary_hue="blue", secondary_hue="
|
|
| 220 |
demo.load(
|
| 221 |
fn=lambda: None,
|
| 222 |
inputs=None,
|
| 223 |
-
outputs=None
|
| 224 |
-
_js="""
|
| 225 |
-
function() {
|
| 226 |
-
document.addEventListener('keydown', function(event) {
|
| 227 |
-
if (event.key === 'Enter') {
|
| 228 |
-
document.querySelector('button').click();
|
| 229 |
-
}
|
| 230 |
-
});
|
| 231 |
-
}
|
| 232 |
-
"""
|
| 233 |
)
|
| 234 |
|
| 235 |
|
|
|
|
| 6 |
from diffusers import DiffusionPipeline, FlowMatchEulerDiscreteScheduler
|
| 7 |
from PIL import Image
|
| 8 |
import io
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
dtype = torch.bfloat16
|
| 11 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
|
|
| 188 |
cache_examples="lazy"
|
| 189 |
)
|
| 190 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 191 |
|
| 192 |
gr.on(
|
| 193 |
triggers=[run_button.click, prompt.submit],
|
|
|
|
| 199 |
demo.load(
|
| 200 |
fn=lambda: None,
|
| 201 |
inputs=None,
|
| 202 |
+
outputs=None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 203 |
)
|
| 204 |
|
| 205 |
|