sayakpaul HF Staff commited on
Commit
699b46e
·
1 Parent(s): ee02270
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -5,6 +5,7 @@ from qwenimage.qwen_fa3_processor import QwenDoubleStreamAttnProcessorFA3
5
  from optimization import get_compiled_transformer
6
  from hub_utils import _push_compiled_graph_to_hub
7
  from huggingface_hub import whoami
 
8
 
9
  # --- Model Loading ---
10
  dtype = torch.bfloat16
@@ -17,6 +18,7 @@ pipe.transformer.set_attn_processor(QwenDoubleStreamAttnProcessorFA3())
17
  # --- Ahead-of-time compilation ---
18
  compiled_transformer = get_compiled_transformer(pipe, prompt="prompt")
19
 
 
20
  def push_to_hub(repo_id, filename, oauth_token: gr.OAuthToken):
21
  if not filename.endswith(".pt2"):
22
  raise NotImplementedError("The filename must end with a `.pt2` extension.")
 
5
  from optimization import get_compiled_transformer
6
  from hub_utils import _push_compiled_graph_to_hub
7
  from huggingface_hub import whoami
8
+ import spaces
9
 
10
  # --- Model Loading ---
11
  dtype = torch.bfloat16
 
18
  # --- Ahead-of-time compilation ---
19
  compiled_transformer = get_compiled_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"):
24
  raise NotImplementedError("The filename must end with a `.pt2` extension.")