Spaces:
Running on Zero
Running on Zero
Commit ·
d49484b
1
Parent(s): 02734ff
[Admin maintenance] Migrate grant to ZeroGPU (#212)
Browse files- [Admin maintenance] Migrate grant to ZeroGPU (e2d5effc1b12dbaa28d7099ee9181a4095bfbf6f)
- app.py +3 -0
- requirements.txt +1 -2
app.py
CHANGED
|
@@ -2,6 +2,7 @@ import io
|
|
| 2 |
import os
|
| 3 |
import uuid
|
| 4 |
|
|
|
|
| 5 |
import gradio as gr
|
| 6 |
import numpy as np
|
| 7 |
import pydub
|
|
@@ -165,6 +166,7 @@ def save_wav_output(image: Image.Image) -> str:
|
|
| 165 |
return output_path
|
| 166 |
|
| 167 |
|
|
|
|
| 168 |
def classic(prompt, negative_prompt, duration, progress=gr.Progress(track_tqdm=True)):
|
| 169 |
progress(0, desc="Loading generation")
|
| 170 |
duration = int(duration)
|
|
@@ -185,6 +187,7 @@ def classic(prompt, negative_prompt, duration, progress=gr.Progress(track_tqdm=T
|
|
| 185 |
return spec, output_wav
|
| 186 |
|
| 187 |
|
|
|
|
| 188 |
def style_transfer(prompt, negative_prompt, audio_input, progress=gr.Progress(track_tqdm=True)):
|
| 189 |
progress(0, desc="Preparing input audio")
|
| 190 |
init_image = spectrogram_image_from_file(audio_input, max_volume=50)
|
|
|
|
| 2 |
import os
|
| 3 |
import uuid
|
| 4 |
|
| 5 |
+
import spaces
|
| 6 |
import gradio as gr
|
| 7 |
import numpy as np
|
| 8 |
import pydub
|
|
|
|
| 166 |
return output_path
|
| 167 |
|
| 168 |
|
| 169 |
+
@spaces.GPU(duration=120)
|
| 170 |
def classic(prompt, negative_prompt, duration, progress=gr.Progress(track_tqdm=True)):
|
| 171 |
progress(0, desc="Loading generation")
|
| 172 |
duration = int(duration)
|
|
|
|
| 187 |
return spec, output_wav
|
| 188 |
|
| 189 |
|
| 190 |
+
@spaces.GPU(duration=120)
|
| 191 |
def style_transfer(prompt, negative_prompt, audio_input, progress=gr.Progress(track_tqdm=True)):
|
| 192 |
progress(0, desc="Preparing input audio")
|
| 193 |
init_image = spectrogram_image_from_file(audio_input, max_volume=50)
|
requirements.txt
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
-
|
| 2 |
-
torchaudio==2.5.1
|
| 3 |
numpy<2
|
| 4 |
scipy
|
| 5 |
pydub
|
|
|
|
| 1 |
+
torchaudio
|
|
|
|
| 2 |
numpy<2
|
| 3 |
scipy
|
| 4 |
pydub
|