Spaces:
Sleeping
Sleeping
Commit
·
30f3714
1
Parent(s):
b4400ab
only two model options
Browse files
app.py
CHANGED
@@ -21,6 +21,9 @@ def get_wavlm():
|
|
21 |
|
22 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
23 |
|
|
|
|
|
|
|
24 |
print("Loading FreeVC...")
|
25 |
hps = utils.get_hparams_from_file("configs/freevc.json")
|
26 |
freevc = SynthesizerTrn(
|
@@ -29,8 +32,7 @@ freevc = SynthesizerTrn(
|
|
29 |
**hps.model).to(device)
|
30 |
_ = freevc.eval()
|
31 |
_ = utils.load_checkpoint("checkpoints/freevc.pth", freevc, None)
|
32 |
-
|
33 |
-
|
34 |
print("Loading FreeVC(24k)...")
|
35 |
hps = utils.get_hparams_from_file("configs/freevc-24.json")
|
36 |
freevc_24 = SynthesizerTrn(
|
@@ -39,7 +41,7 @@ freevc_24 = SynthesizerTrn(
|
|
39 |
**hps.model).to(device)
|
40 |
_ = freevc_24.eval()
|
41 |
_ = utils.load_checkpoint("checkpoints/freevc-24.pth", freevc_24, None)
|
42 |
-
|
43 |
print("Loading FreeVC-s...")
|
44 |
hps = utils.get_hparams_from_file("configs/freevc-s.json")
|
45 |
freevc_s = SynthesizerTrn(
|
@@ -58,6 +60,7 @@ freevc_cvfr = SynthesizerTrn(
|
|
58 |
**hps.model).to(device)
|
59 |
_ = freevc_cvfr.eval()
|
60 |
_ = utils.load_checkpoint("checkpoints/freevc-cvfr.pth", freevc_cvfr, None)
|
|
|
61 |
|
62 |
print("Loading FreeVC-mls...")
|
63 |
hps = utils.get_hparams_from_file("configs/freevc_nosr_mls.json")
|
@@ -134,7 +137,7 @@ def convert(model, src_mic,src_file, tgt):
|
|
134 |
out = "out.wav"
|
135 |
return out
|
136 |
|
137 |
-
model = gr.Dropdown(choices=["FreeVC
|
138 |
audio1_mic=gr.Audio(source="microphone", type="filepath", label='record your voice', optional=True)
|
139 |
audio1_file = gr.inputs.Audio(type='filepath', label='or upload an audio file', optional=True)
|
140 |
audio2 = gr.inputs.Audio(label="Reference Audio", type='filepath', default='52_4703_000002.wav')
|
@@ -156,6 +159,6 @@ article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2210.154
|
|
156 |
"<a href='https://arxiv.org/abs/2110.13900' target='_blank'>Article WavLM</a> | "
|
157 |
"<a href='http://www.openslr.org/94/' target='_blank'>Jeu de données MLS</a></p>"
|
158 |
|
159 |
-
examples=[["FreeVC"
|
160 |
|
161 |
gr.Interface(convert, inputs, outputs, title=title, description=description, article=article, examples=examples, enable_queue=True).launch()
|
|
|
21 |
|
22 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
23 |
|
24 |
+
smodel = SpeakerEncoder('speaker_encoder/ckpt/pretrained_bak_5805000.pt')
|
25 |
+
|
26 |
+
'''
|
27 |
print("Loading FreeVC...")
|
28 |
hps = utils.get_hparams_from_file("configs/freevc.json")
|
29 |
freevc = SynthesizerTrn(
|
|
|
32 |
**hps.model).to(device)
|
33 |
_ = freevc.eval()
|
34 |
_ = utils.load_checkpoint("checkpoints/freevc.pth", freevc, None)
|
35 |
+
'''
|
|
|
36 |
print("Loading FreeVC(24k)...")
|
37 |
hps = utils.get_hparams_from_file("configs/freevc-24.json")
|
38 |
freevc_24 = SynthesizerTrn(
|
|
|
41 |
**hps.model).to(device)
|
42 |
_ = freevc_24.eval()
|
43 |
_ = utils.load_checkpoint("checkpoints/freevc-24.pth", freevc_24, None)
|
44 |
+
'''
|
45 |
print("Loading FreeVC-s...")
|
46 |
hps = utils.get_hparams_from_file("configs/freevc-s.json")
|
47 |
freevc_s = SynthesizerTrn(
|
|
|
60 |
**hps.model).to(device)
|
61 |
_ = freevc_cvfr.eval()
|
62 |
_ = utils.load_checkpoint("checkpoints/freevc-cvfr.pth", freevc_cvfr, None)
|
63 |
+
'''
|
64 |
|
65 |
print("Loading FreeVC-mls...")
|
66 |
hps = utils.get_hparams_from_file("configs/freevc_nosr_mls.json")
|
|
|
137 |
out = "out.wav"
|
138 |
return out
|
139 |
|
140 |
+
model = gr.Dropdown(choices=["FreeVC MLS","FreeVC (24kHz)"], value="FreeVC MLS",type="value", label="Model")
|
141 |
audio1_mic=gr.Audio(source="microphone", type="filepath", label='record your voice', optional=True)
|
142 |
audio1_file = gr.inputs.Audio(type='filepath', label='or upload an audio file', optional=True)
|
143 |
audio2 = gr.inputs.Audio(label="Reference Audio", type='filepath', default='52_4703_000002.wav')
|
|
|
159 |
"<a href='https://arxiv.org/abs/2110.13900' target='_blank'>Article WavLM</a> | "
|
160 |
"<a href='http://www.openslr.org/94/' target='_blank'>Jeu de données MLS</a></p>"
|
161 |
|
162 |
+
examples=[["FreeVC MLS",, '10032_9061_000004.flac, ' 52_4703_000002.wav'], ["FreeVC MLS",, ' SAMPLE_HUGO_METEO.wav', '52_4703_000002.wav'], ["FreeVC MLS",,' SAMPLE_NADINE_MALICIEUX.wav, '52_4703_000002.wav']]
|
163 |
|
164 |
gr.Interface(convert, inputs, outputs, title=title, description=description, article=article, examples=examples, enable_queue=True).launch()
|