Spaces:
Running on Zero
Running on Zero
fix: lower ZeroGPU duration to 120s for free-tier users
Browse filesAll @spaces.GPU(duration=...) decorators exceeded the free-tier
ZeroGPU maximum, causing instant rejection before generation starts.
Lowered all durations from 180-300s to 120s to fix the error:
'The requested GPU duration (300s) is larger than the maximum allowed'
Fixes: community reported issue on HuggingFace Space
acestep/gradio_ui/events/__init__.py
CHANGED
|
@@ -263,7 +263,7 @@ def setup_event_handlers(demo, dit_handler, llm_handler, dataset_handler, datase
|
|
| 263 |
|
| 264 |
# ========== Format Button ==========
|
| 265 |
# Note: cfg_scale and negative_prompt are not supported in format mode
|
| 266 |
-
@_get_spaces_gpu_decorator(duration=
|
| 267 |
def handle_format_sample_wrapper(caption, lyrics, bpm, duration, key_scale, time_sig, temp, top_k, top_p, debug):
|
| 268 |
return gen_h.handle_format_sample(
|
| 269 |
llm_handler, caption, lyrics, bpm, duration, key_scale, time_sig, temp, top_k, top_p, debug
|
|
@@ -320,7 +320,7 @@ def setup_event_handlers(demo, dit_handler, llm_handler, dataset_handler, datase
|
|
| 320 |
# not on a module-level function wrapped in a lambda. Lambdas capturing handler
|
| 321 |
# objects cause pickling errors on ZeroGPU because the model contains unpicklable
|
| 322 |
# local objects (e.g. AceStepDiTModel.__init__ lambdas).
|
| 323 |
-
@_get_spaces_gpu_decorator(duration=
|
| 324 |
def process_source_audio_wrapper(src, debug):
|
| 325 |
return gen_h.process_source_audio(dit_handler, llm_handler, src, debug)
|
| 326 |
|
|
@@ -365,7 +365,7 @@ def setup_event_handlers(demo, dit_handler, llm_handler, dataset_handler, datase
|
|
| 365 |
|
| 366 |
# ========== Create Sample Button (Simple Mode) ==========
|
| 367 |
# Note: cfg_scale and negative_prompt are not supported in create_sample mode
|
| 368 |
-
@_get_spaces_gpu_decorator(duration=
|
| 369 |
def handle_create_sample_wrapper(query, instrumental, vocal_lang, temp, top_k, top_p, debug):
|
| 370 |
return gen_h.handle_create_sample(
|
| 371 |
llm_handler, query, instrumental, vocal_lang, temp, top_k, top_p, debug
|
|
@@ -612,7 +612,7 @@ def setup_event_handlers(demo, dit_handler, llm_handler, dataset_handler, datase
|
|
| 612 |
# Note: @spaces.GPU decorator applied here (not on module-level function) to avoid
|
| 613 |
# pickling issues on ZeroGPU when handler objects are captured in closures.
|
| 614 |
def make_score_handler(idx):
|
| 615 |
-
@_get_spaces_gpu_decorator(duration=
|
| 616 |
def score_handler(scale, batch_idx, queue):
|
| 617 |
return res_h.calculate_score_handler_with_selection(
|
| 618 |
dit_handler, llm_handler, idx, scale, batch_idx, queue
|
|
@@ -637,7 +637,7 @@ def setup_event_handlers(demo, dit_handler, llm_handler, dataset_handler, datase
|
|
| 637 |
# ========== LRC Timestamp Handlers ==========
|
| 638 |
# Use default argument to capture btn_idx value at definition time (Python closure fix)
|
| 639 |
def make_lrc_handler(idx):
|
| 640 |
-
@_get_spaces_gpu_decorator(duration=
|
| 641 |
def lrc_handler(batch_idx, queue, vocal_lang, infer_steps):
|
| 642 |
return res_h.generate_lrc_handler(
|
| 643 |
dit_handler, idx, batch_idx, queue, vocal_lang, infer_steps
|
|
@@ -662,7 +662,7 @@ def setup_event_handlers(demo, dit_handler, llm_handler, dataset_handler, datase
|
|
| 662 |
]
|
| 663 |
)
|
| 664 |
|
| 665 |
-
@_get_spaces_gpu_decorator(duration=
|
| 666 |
def generation_wrapper(selected_model, generation_mode, simple_query_input, simple_vocal_language, *args):
|
| 667 |
"""Wrapper that selects the appropriate DiT handler based on model selection"""
|
| 668 |
# Convert args to list for modification
|
|
|
|
| 263 |
|
| 264 |
# ========== Format Button ==========
|
| 265 |
# Note: cfg_scale and negative_prompt are not supported in format mode
|
| 266 |
+
@_get_spaces_gpu_decorator(duration=120)
|
| 267 |
def handle_format_sample_wrapper(caption, lyrics, bpm, duration, key_scale, time_sig, temp, top_k, top_p, debug):
|
| 268 |
return gen_h.handle_format_sample(
|
| 269 |
llm_handler, caption, lyrics, bpm, duration, key_scale, time_sig, temp, top_k, top_p, debug
|
|
|
|
| 320 |
# not on a module-level function wrapped in a lambda. Lambdas capturing handler
|
| 321 |
# objects cause pickling errors on ZeroGPU because the model contains unpicklable
|
| 322 |
# local objects (e.g. AceStepDiTModel.__init__ lambdas).
|
| 323 |
+
@_get_spaces_gpu_decorator(duration=120)
|
| 324 |
def process_source_audio_wrapper(src, debug):
|
| 325 |
return gen_h.process_source_audio(dit_handler, llm_handler, src, debug)
|
| 326 |
|
|
|
|
| 365 |
|
| 366 |
# ========== Create Sample Button (Simple Mode) ==========
|
| 367 |
# Note: cfg_scale and negative_prompt are not supported in create_sample mode
|
| 368 |
+
@_get_spaces_gpu_decorator(duration=120)
|
| 369 |
def handle_create_sample_wrapper(query, instrumental, vocal_lang, temp, top_k, top_p, debug):
|
| 370 |
return gen_h.handle_create_sample(
|
| 371 |
llm_handler, query, instrumental, vocal_lang, temp, top_k, top_p, debug
|
|
|
|
| 612 |
# Note: @spaces.GPU decorator applied here (not on module-level function) to avoid
|
| 613 |
# pickling issues on ZeroGPU when handler objects are captured in closures.
|
| 614 |
def make_score_handler(idx):
|
| 615 |
+
@_get_spaces_gpu_decorator(duration=120)
|
| 616 |
def score_handler(scale, batch_idx, queue):
|
| 617 |
return res_h.calculate_score_handler_with_selection(
|
| 618 |
dit_handler, llm_handler, idx, scale, batch_idx, queue
|
|
|
|
| 637 |
# ========== LRC Timestamp Handlers ==========
|
| 638 |
# Use default argument to capture btn_idx value at definition time (Python closure fix)
|
| 639 |
def make_lrc_handler(idx):
|
| 640 |
+
@_get_spaces_gpu_decorator(duration=120)
|
| 641 |
def lrc_handler(batch_idx, queue, vocal_lang, infer_steps):
|
| 642 |
return res_h.generate_lrc_handler(
|
| 643 |
dit_handler, idx, batch_idx, queue, vocal_lang, infer_steps
|
|
|
|
| 662 |
]
|
| 663 |
)
|
| 664 |
|
| 665 |
+
@_get_spaces_gpu_decorator(duration=120)
|
| 666 |
def generation_wrapper(selected_model, generation_mode, simple_query_input, simple_vocal_language, *args):
|
| 667 |
"""Wrapper that selects the appropriate DiT handler based on model selection"""
|
| 668 |
# Convert args to list for modification
|