Spaces:
Sleeping
Sleeping
Update hf_gradio_app.py
Browse files- hf_gradio_app.py +3 -3
hf_gradio_app.py
CHANGED
|
@@ -86,7 +86,7 @@ def process_audio(file_path, temp_dir):
|
|
| 86 |
audio = AudioSegment.from_file(file_path)
|
| 87 |
|
| 88 |
# Check and cut the audio if longer than 4 seconds
|
| 89 |
-
max_duration =
|
| 90 |
if len(audio) > max_duration:
|
| 91 |
audio = audio[:max_duration]
|
| 92 |
|
|
@@ -99,7 +99,7 @@ def process_audio(file_path, temp_dir):
|
|
| 99 |
return output_path
|
| 100 |
|
| 101 |
|
| 102 |
-
@spaces.GPU(duration=
|
| 103 |
@torch.inference_mode()
|
| 104 |
def generate(input_video, input_audio, seed, progress=gr.Progress(track_tqdm=True)):
|
| 105 |
"""
|
|
@@ -116,7 +116,7 @@ def generate(input_video, input_audio, seed, progress=gr.Progress(track_tqdm=Tru
|
|
| 116 |
str: File path to the generated output video (MP4 format).
|
| 117 |
"""
|
| 118 |
|
| 119 |
-
gr.Info("
|
| 120 |
|
| 121 |
pipeline.reference_net.enable_xformers_memory_efficient_attention()
|
| 122 |
pipeline.diffusion_net.enable_xformers_memory_efficient_attention()
|
|
|
|
| 86 |
audio = AudioSegment.from_file(file_path)
|
| 87 |
|
| 88 |
# Check and cut the audio if longer than 4 seconds
|
| 89 |
+
max_duration = 9 * 1000 # 4 seconds in milliseconds
|
| 90 |
if len(audio) > max_duration:
|
| 91 |
audio = audio[:max_duration]
|
| 92 |
|
|
|
|
| 99 |
return output_path
|
| 100 |
|
| 101 |
|
| 102 |
+
@spaces.GPU(duration=540)
|
| 103 |
@torch.inference_mode()
|
| 104 |
def generate(input_video, input_audio, seed, progress=gr.Progress(track_tqdm=True)):
|
| 105 |
"""
|
|
|
|
| 116 |
str: File path to the generated output video (MP4 format).
|
| 117 |
"""
|
| 118 |
|
| 119 |
+
gr.Info("540 seconds will be allocated from your daily ZeroGPU time credits.")
|
| 120 |
|
| 121 |
pipeline.reference_net.enable_xformers_memory_efficient_attention()
|
| 122 |
pipeline.diffusion_net.enable_xformers_memory_efficient_attention()
|