Spaces:
Running
on
Zero
Running
on
Zero
up
Browse files
app.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
import spaces
|
| 3 |
import torch
|
| 4 |
from diffusers import DiffusionPipeline
|
| 5 |
from optimization import compile_transformer
|
|
@@ -14,8 +13,6 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
| 14 |
# Load the model pipeline
|
| 15 |
pipe = DiffusionPipeline.from_pretrained("black-forest-labs/Flux.1-Dev", torch_dtype=dtype).to(device)
|
| 16 |
|
| 17 |
-
|
| 18 |
-
@spaces.GPU
|
| 19 |
def push_to_hub(repo_id, filename, oauth_token: gr.OAuthToken, progress=gr.Progress(track_tqdm=True)):
|
| 20 |
if not filename.endswith(".pt2"):
|
| 21 |
raise NotImplementedError("The filename must end with a `.pt2` extension.")
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
import torch
|
| 3 |
from diffusers import DiffusionPipeline
|
| 4 |
from optimization import compile_transformer
|
|
|
|
| 13 |
# Load the model pipeline
|
| 14 |
pipe = DiffusionPipeline.from_pretrained("black-forest-labs/Flux.1-Dev", torch_dtype=dtype).to(device)
|
| 15 |
|
|
|
|
|
|
|
| 16 |
def push_to_hub(repo_id, filename, oauth_token: gr.OAuthToken, progress=gr.Progress(track_tqdm=True)):
|
| 17 |
if not filename.endswith(".pt2"):
|
| 18 |
raise NotImplementedError("The filename must end with a `.pt2` extension.")
|