Spaces:
Running
on
Zero
Running
on
Zero
chong.zhang
commited on
Commit
·
693c129
1
Parent(s):
d4e3963
update
Browse files
app.py
CHANGED
@@ -13,15 +13,6 @@
|
|
13 |
# limitations under the License.
|
14 |
|
15 |
import os
|
16 |
-
import spaces
|
17 |
-
import gradio as gr
|
18 |
-
from inspiremusic.cli.inference import InspireMusicUnified, set_env_variables
|
19 |
-
import torchaudio
|
20 |
-
import datetime
|
21 |
-
import hashlib
|
22 |
-
import torch
|
23 |
-
import importlib
|
24 |
-
import sys
|
25 |
|
26 |
os.system('nvidia-smi')
|
27 |
os.system('apt update -y && apt-get install -y apt-utils && apt install -y unzip')
|
@@ -32,12 +23,23 @@ os.environ['PYTHONPATH'] = 'third_party/Matcha-TTS'
|
|
32 |
os.system('mkdir pretrained_models && cd pretrained_models && git clone https://huggingface.co/FunAudioLLM/InspireMusic-Base.git &&git clone https://huggingface.co/FunAudioLLM/InspireMusic-1.5B-Long.git &&git clone https://huggingface.co/FunAudioLLM/InspireMusic-1.5B.git &&git clone https://huggingface.co/FunAudioLLM/InspireMusic-1.5B-24kHz.git &&git clone https://huggingface.co/FunAudioLLM/InspireMusic-Base-24kHz.git && for i in InspireMusic-Base InspireMusic-Base-24kHz InspireMusic-1.5B InspireMusic-1.5B-24kHz InspireMusic-1.5B-Long; do sed -i -e "s/\.\.\/\.\.\///g" ${i}/inspiremusic.yaml; done && cd ..')
|
33 |
|
34 |
# os.system('mkdir pretrained_models && cd pretrained_models && git clone https://huggingface.co/FunAudioLLM/InspireMusic-Base.git && for i in InspireMusic-Base; do sed -i -e "s/\.\.\/\.\.\///g" ${i}/inspiremusic.yaml; done && cd ..')
|
35 |
-
|
|
|
36 |
print(torch.backends.cudnn.version())
|
37 |
|
38 |
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
39 |
sys.path.append('{}/third_party/Matcha-TTS'.format(ROOT_DIR))
|
40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
def generate_filename():
|
42 |
hash_object = hashlib.sha256(str(int(datetime.datetime.now().timestamp())).encode())
|
43 |
hash_string = hash_object.hexdigest()
|
@@ -154,7 +156,7 @@ def main():
|
|
154 |
""")
|
155 |
|
156 |
with gr.Row(equal_height=True):
|
157 |
-
model_name = gr.Dropdown(
|
158 |
chorus = gr.Dropdown(["intro", "verse", "chorus", "outro"],
|
159 |
label="Chorus Mode", value="intro")
|
160 |
output_sample_rate = gr.Dropdown([48000, 24000],
|
|
|
13 |
# limitations under the License.
|
14 |
|
15 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
os.system('nvidia-smi')
|
18 |
os.system('apt update -y && apt-get install -y apt-utils && apt install -y unzip')
|
|
|
23 |
os.system('mkdir pretrained_models && cd pretrained_models && git clone https://huggingface.co/FunAudioLLM/InspireMusic-Base.git &&git clone https://huggingface.co/FunAudioLLM/InspireMusic-1.5B-Long.git &&git clone https://huggingface.co/FunAudioLLM/InspireMusic-1.5B.git &&git clone https://huggingface.co/FunAudioLLM/InspireMusic-1.5B-24kHz.git &&git clone https://huggingface.co/FunAudioLLM/InspireMusic-Base-24kHz.git && for i in InspireMusic-Base InspireMusic-Base-24kHz InspireMusic-1.5B InspireMusic-1.5B-24kHz InspireMusic-1.5B-Long; do sed -i -e "s/\.\.\/\.\.\///g" ${i}/inspiremusic.yaml; done && cd ..')
|
24 |
|
25 |
# os.system('mkdir pretrained_models && cd pretrained_models && git clone https://huggingface.co/FunAudioLLM/InspireMusic-Base.git && for i in InspireMusic-Base; do sed -i -e "s/\.\.\/\.\.\///g" ${i}/inspiremusic.yaml; done && cd ..')
|
26 |
+
import sys
|
27 |
+
import torch
|
28 |
print(torch.backends.cudnn.version())
|
29 |
|
30 |
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
31 |
sys.path.append('{}/third_party/Matcha-TTS'.format(ROOT_DIR))
|
32 |
|
33 |
+
import spaces
|
34 |
+
import gradio as gr
|
35 |
+
from inspiremusic.cli.inference import InspireMusicUnified, set_env_variables
|
36 |
+
import torchaudio
|
37 |
+
import datetime
|
38 |
+
import hashlib
|
39 |
+
import importlib
|
40 |
+
|
41 |
+
MODELS = ["InspireMusic-1.5B-Long", "InspireMusic-1.5B", "InspireMusic-1.5B-24kHz", "InspireMusic-Base", "InspireMusic-Base-24kHz"]
|
42 |
+
|
43 |
def generate_filename():
|
44 |
hash_object = hashlib.sha256(str(int(datetime.datetime.now().timestamp())).encode())
|
45 |
hash_string = hash_object.hexdigest()
|
|
|
156 |
""")
|
157 |
|
158 |
with gr.Row(equal_height=True):
|
159 |
+
model_name = gr.Dropdown(MODELS, label="Select Model Name", value="InspireMusic-1.5B-Long")
|
160 |
chorus = gr.Dropdown(["intro", "verse", "chorus", "outro"],
|
161 |
label="Chorus Mode", value="intro")
|
162 |
output_sample_rate = gr.Dropdown([48000, 24000],
|