Update app.py
Browse files
app.py
CHANGED
@@ -119,7 +119,6 @@ def split_lyrics(lyrics: str):
|
|
119 |
# ---------------------------
|
120 |
# CUDA Heavy Functions
|
121 |
# ---------------------------
|
122 |
-
@spaces.GPU(duration=175)
|
123 |
def requires_cuda_generation(input_ids, max_new_tokens, top_p, temperature, repetition_penalty, guidance_scale):
|
124 |
"""
|
125 |
Performs the CUDA-intensive generation using the language model.
|
@@ -148,7 +147,6 @@ def requires_cuda_generation(input_ids, max_new_tokens, top_p, temperature, repe
|
|
148 |
output_seq = torch.cat((output_seq, tensor_eoa), dim=1)
|
149 |
return output_seq
|
150 |
|
151 |
-
@spaces.GPU(duration=15)
|
152 |
def requires_cuda_decode(codec_result):
|
153 |
"""
|
154 |
Uses the codec model on the GPU to decode a given numpy array of codec IDs
|
@@ -175,6 +173,7 @@ def save_audio(wav: torch.Tensor, sample_rate: int, rescale: bool = False):
|
|
175 |
# ---------------------------------------------------------------------
|
176 |
# Main Generation Function (without temporary files/directories)
|
177 |
# ---------------------------------------------------------------------
|
|
|
178 |
def generate_music(
|
179 |
genre_txt=None,
|
180 |
lyrics_txt=None,
|
|
|
119 |
# ---------------------------
|
120 |
# CUDA Heavy Functions
|
121 |
# ---------------------------
|
|
|
122 |
def requires_cuda_generation(input_ids, max_new_tokens, top_p, temperature, repetition_penalty, guidance_scale):
|
123 |
"""
|
124 |
Performs the CUDA-intensive generation using the language model.
|
|
|
147 |
output_seq = torch.cat((output_seq, tensor_eoa), dim=1)
|
148 |
return output_seq
|
149 |
|
|
|
150 |
def requires_cuda_decode(codec_result):
|
151 |
"""
|
152 |
Uses the codec model on the GPU to decode a given numpy array of codec IDs
|
|
|
173 |
# ---------------------------------------------------------------------
|
174 |
# Main Generation Function (without temporary files/directories)
|
175 |
# ---------------------------------------------------------------------
|
176 |
+
@spaces.GPU(duration=175)
|
177 |
def generate_music(
|
178 |
genre_txt=None,
|
179 |
lyrics_txt=None,
|