Spaces:
Running
on
Zero
Running
on
Zero
Adapted this code from fffiloni/YuE
Browse files
app.py
CHANGED
@@ -3,8 +3,9 @@ import subprocess
|
|
3 |
import os
|
4 |
import shutil
|
5 |
import tempfile
|
|
|
6 |
|
7 |
-
is_shared_ui = True if "/" in os.environ['SPACE_ID'] else False
|
8 |
|
9 |
# Install required package
|
10 |
def install_flash_attn():
|
@@ -101,6 +102,7 @@ def get_last_mp3_file(output_dir):
|
|
101 |
# Return the most recent .mp3 file
|
102 |
return mp3_files_with_path[0]
|
103 |
|
|
|
104 |
def infer(genre_txt_content, lyrics_txt_content, num_segments, max_new_tokens):
|
105 |
# Create temporary files
|
106 |
genre_txt_path = create_temp_file(genre_txt_content, prefix="genre_")
|
@@ -184,7 +186,7 @@ with gr.Blocks() as demo:
|
|
184 |
<a href="https://map-yue.github.io">
|
185 |
<img src='https://img.shields.io/badge/Project-Page-green'>
|
186 |
</a>
|
187 |
-
<a href="https://huggingface.co/spaces/
|
188 |
<img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-sm.svg" alt="Duplicate this Space">
|
189 |
</a>
|
190 |
</div>
|
|
|
3 |
import os
|
4 |
import shutil
|
5 |
import tempfile
|
6 |
+
import spaces
|
7 |
|
8 |
+
is_shared_ui = True if "innova-ai/YuE-music-generator-demo" in os.environ['SPACE_ID'] else False
|
9 |
|
10 |
# Install required package
|
11 |
def install_flash_attn():
|
|
|
102 |
# Return the most recent .mp3 file
|
103 |
return mp3_files_with_path[0]
|
104 |
|
105 |
+
@spaces.GPU
|
106 |
def infer(genre_txt_content, lyrics_txt_content, num_segments, max_new_tokens):
|
107 |
# Create temporary files
|
108 |
genre_txt_path = create_temp_file(genre_txt_content, prefix="genre_")
|
|
|
186 |
<a href="https://map-yue.github.io">
|
187 |
<img src='https://img.shields.io/badge/Project-Page-green'>
|
188 |
</a>
|
189 |
+
<a href="https://huggingface.co/spaces/innova-ai/YuE-music-generator-demo?duplicate=true">
|
190 |
<img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-sm.svg" alt="Duplicate this Space">
|
191 |
</a>
|
192 |
</div>
|