Spaces:
Running
on
L40S
Running
on
L40S
fix bug
Browse files
app.py
CHANGED
@@ -6,7 +6,6 @@ import time
|
|
6 |
import re
|
7 |
import os.path as op
|
8 |
from download import download_model
|
9 |
-
|
10 |
# 下载模型
|
11 |
APP_DIR = op.dirname(op.abspath(__file__))
|
12 |
download_model(APP_DIR)
|
@@ -65,7 +64,7 @@ def generate_song(lyric, description=None, prompt_audio=None, genre=None, cfg_co
|
|
65 |
sample_rate = MODEL.cfg.sample_rate
|
66 |
|
67 |
# 适配lyric格式
|
68 |
-
lyric = re.sub(r"[^\w\s\[\]
|
69 |
lyric = lyric.lower()
|
70 |
lyric = lyric.replace("[intro]", "[intro-short]").replace("[inst]", "[inst-short]").replace("[outro]", "[outro-short]")
|
71 |
lyric = lyric.replace("\n\n", " ; ")
|
|
|
6 |
import re
|
7 |
import os.path as op
|
8 |
from download import download_model
|
|
|
9 |
# 下载模型
|
10 |
APP_DIR = op.dirname(op.abspath(__file__))
|
11 |
download_model(APP_DIR)
|
|
|
64 |
sample_rate = MODEL.cfg.sample_rate
|
65 |
|
66 |
# 适配lyric格式
|
67 |
+
lyric = re.sub(r"[^\w\s\[\]\-\u4e00-\u9fff\u3040-\u309f\u30a0-\u30ff\uac00-\ud7af\u00c0-\u017f]", "", lyric)
|
68 |
lyric = lyric.lower()
|
69 |
lyric = lyric.replace("[intro]", "[intro-short]").replace("[inst]", "[inst-short]").replace("[outro]", "[outro-short]")
|
70 |
lyric = lyric.replace("\n\n", " ; ")
|