Spaces:
Runtime error
Runtime error
hungchiayu1
commited on
Commit
•
a117171
1
Parent(s):
d6c327b
fixed bugs
Browse files
app.py
CHANGED
@@ -8,6 +8,7 @@ from models import AudioDiffusion, DDPMScheduler
|
|
8 |
from audioldm.audio.stft import TacotronSTFT
|
9 |
from audioldm.variational_autoencoder import AutoencoderKL
|
10 |
from gradio import Markdown
|
|
|
11 |
|
12 |
class Tango:
|
13 |
def __init__(self, name="declare-lab/tango2", device="cuda:0"):
|
@@ -71,7 +72,8 @@ if torch.cuda.is_available():
|
|
71 |
tango = Tango()
|
72 |
else:
|
73 |
tango = Tango(device="cpu")
|
74 |
-
|
|
|
75 |
def gradio_generate(prompt, steps, guidance):
|
76 |
output_wave = tango.generate(prompt, steps, guidance)
|
77 |
# output_filename = f"{prompt.replace(' ', '_')}_{steps}_{guidance}"[:250] + ".wav"
|
|
|
8 |
from audioldm.audio.stft import TacotronSTFT
|
9 |
from audioldm.variational_autoencoder import AutoencoderKL
|
10 |
from gradio import Markdown
|
11 |
+
import spaces
|
12 |
|
13 |
class Tango:
|
14 |
def __init__(self, name="declare-lab/tango2", device="cuda:0"):
|
|
|
72 |
tango = Tango()
|
73 |
else:
|
74 |
tango = Tango(device="cpu")
|
75 |
+
|
76 |
+
@spaces.GPU(duration=240)
|
77 |
def gradio_generate(prompt, steps, guidance):
|
78 |
output_wave = tango.generate(prompt, steps, guidance)
|
79 |
# output_filename = f"{prompt.replace(' ', '_')}_{steps}_{guidance}"[:250] + ".wav"
|