Spaces:
Running
Running
Commit
·
dbd9c01
1
Parent(s):
1eb0098
自动加载最新模型
Browse files
app.py
CHANGED
@@ -58,6 +58,7 @@ device = (
|
|
58 |
)
|
59 |
|
60 |
BandList = {
|
|
|
61 |
"Afterglow":["蘭","モカ","ひまり","巴","つぐみ"],
|
62 |
"HelloHappyWorld":["こころ","美咲","薫","花音","はぐみ"],
|
63 |
"PastelPalettes":["彩","日菜","千聖","イヴ","麻弥"],
|
@@ -213,17 +214,17 @@ if __name__ == "__main__":
|
|
213 |
REPO_ID = "audeering/wav2vec2-large-robust-12-ft-emotion-msp-dim"
|
214 |
emotional_processor = Wav2Vec2Processor.from_pretrained(emotional_model_name)
|
215 |
emotional_model = EmotionModel.from_pretrained(emotional_model_name).to(device)
|
216 |
-
hps = utils.get_hparams_from_file('Data/Bushiroad/configs/config.json')
|
217 |
-
net_g = get_net_g(
|
218 |
-
model_path='Data/Bushiroad/models/G_29000.pth', version="2.1", device=device, hps=hps
|
219 |
-
)
|
220 |
-
speaker_ids = hps.data.spk2id
|
221 |
-
speakers = list(speaker_ids.keys())
|
222 |
languages = [ "Auto", "ZH", "JP"]
|
223 |
modelPaths = []
|
224 |
for dirpath, dirnames, filenames in os.walk("Data/Bushiroad/models/"):
|
225 |
for filename in filenames:
|
226 |
modelPaths.append(os.path.join(dirpath, filename))
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
with gr.Blocks() as app:
|
228 |
for band in BandList:
|
229 |
with gr.TabItem(band):
|
@@ -298,4 +299,4 @@ if __name__ == "__main__":
|
|
298 |
)
|
299 |
|
300 |
print("推理页面已开启!")
|
301 |
-
app.launch()
|
|
|
58 |
)
|
59 |
|
60 |
BandList = {
|
61 |
+
#"PoppinParty":["香澄","有咲","たえ","りみ","沙綾"],
|
62 |
"Afterglow":["蘭","モカ","ひまり","巴","つぐみ"],
|
63 |
"HelloHappyWorld":["こころ","美咲","薫","花音","はぐみ"],
|
64 |
"PastelPalettes":["彩","日菜","千聖","イヴ","麻弥"],
|
|
|
214 |
REPO_ID = "audeering/wav2vec2-large-robust-12-ft-emotion-msp-dim"
|
215 |
emotional_processor = Wav2Vec2Processor.from_pretrained(emotional_model_name)
|
216 |
emotional_model = EmotionModel.from_pretrained(emotional_model_name).to(device)
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
languages = [ "Auto", "ZH", "JP"]
|
218 |
modelPaths = []
|
219 |
for dirpath, dirnames, filenames in os.walk("Data/Bushiroad/models/"):
|
220 |
for filename in filenames:
|
221 |
modelPaths.append(os.path.join(dirpath, filename))
|
222 |
+
hps = utils.get_hparams_from_file('Data/Bushiroad/configs/config.json')
|
223 |
+
net_g = get_net_g(
|
224 |
+
model_path=modelPaths[-1], version="2.1", device=device, hps=hps
|
225 |
+
)
|
226 |
+
speaker_ids = hps.data.spk2id
|
227 |
+
speakers = list(speaker_ids.keys())
|
228 |
with gr.Blocks() as app:
|
229 |
for band in BandList:
|
230 |
with gr.TabItem(band):
|
|
|
299 |
)
|
300 |
|
301 |
print("推理页面已开启!")
|
302 |
+
app.launch(share=True)
|