Spaces:
Sleeping
Sleeping
up
Browse files
app.py
CHANGED
|
@@ -15,9 +15,6 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
| 15 |
pipe = QwenImagePipeline.from_pretrained("Qwen/Qwen-Image", torch_dtype=dtype).to(device)
|
| 16 |
pipe.transformer.set_attn_processor(QwenDoubleStreamAttnProcessorFA3())
|
| 17 |
|
| 18 |
-
# --- Ahead-of-time compilation ---
|
| 19 |
-
compiled_transformer = compile_transformer(pipe, prompt="prompt")
|
| 20 |
-
|
| 21 |
@spaces.GPU(duration=120)
|
| 22 |
def push_to_hub(repo_id, filename, oauth_token: gr.OAuthToken):
|
| 23 |
if not filename.endswith(".pt2"):
|
|
@@ -26,6 +23,9 @@ def push_to_hub(repo_id, filename, oauth_token: gr.OAuthToken):
|
|
| 26 |
# this will throw if token is invalid
|
| 27 |
_ = whoami(oauth_token.token)
|
| 28 |
|
|
|
|
|
|
|
|
|
|
| 29 |
token = oauth_token.token
|
| 30 |
out = _push_compiled_graph_to_hub(
|
| 31 |
compiled_transformer.archive_file,
|
|
|
|
| 15 |
pipe = QwenImagePipeline.from_pretrained("Qwen/Qwen-Image", torch_dtype=dtype).to(device)
|
| 16 |
pipe.transformer.set_attn_processor(QwenDoubleStreamAttnProcessorFA3())
|
| 17 |
|
|
|
|
|
|
|
|
|
|
| 18 |
@spaces.GPU(duration=120)
|
| 19 |
def push_to_hub(repo_id, filename, oauth_token: gr.OAuthToken):
|
| 20 |
if not filename.endswith(".pt2"):
|
|
|
|
| 23 |
# this will throw if token is invalid
|
| 24 |
_ = whoami(oauth_token.token)
|
| 25 |
|
| 26 |
+
# --- Ahead-of-time compilation ---
|
| 27 |
+
compiled_transformer = compile_transformer(pipe, prompt="prompt")
|
| 28 |
+
|
| 29 |
token = oauth_token.token
|
| 30 |
out = _push_compiled_graph_to_hub(
|
| 31 |
compiled_transformer.archive_file,
|