Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,7 +38,7 @@ def get_text(text, hps):
|
|
| 38 |
|
| 39 |
|
| 40 |
hps = utils.get_hparams_from_file("configs/ljs_base.json")
|
| 41 |
-
hps_ms = utils.get_hparams_from_file("configs/
|
| 42 |
net_g_ms = SynthesizerTrn(
|
| 43 |
len(symbols),
|
| 44 |
hps_ms.data.filter_length // 2 + 1,
|
|
@@ -50,7 +50,7 @@ import numpy as np
|
|
| 50 |
|
| 51 |
hubert = torch.hub.load("bshall/hubert:main", "hubert_soft")
|
| 52 |
|
| 53 |
-
_ = utils.load_checkpoint("
|
| 54 |
|
| 55 |
def vc_fn(input_audio,vc_transform):
|
| 56 |
if input_audio is None:
|
|
@@ -77,7 +77,7 @@ def vc_fn(input_audio,vc_transform):
|
|
| 77 |
print(sampling_rate)
|
| 78 |
f0 = resize2d(f0, len(soft[:, 0])) * vc_transform
|
| 79 |
soft[:, 0] = f0 / 10
|
| 80 |
-
sid = torch.LongTensor([
|
| 81 |
stn_tst = torch.FloatTensor(soft)
|
| 82 |
with torch.no_grad():
|
| 83 |
x_tst = stn_tst.unsqueeze(0)
|
|
@@ -95,6 +95,7 @@ with app:
|
|
| 95 |
with gr.TabItem("Basic"):
|
| 96 |
vc_input3 = gr.Audio(label="Input Audio (30s limitation)")
|
| 97 |
vc_transform = gr.Number(label="transform",value=1.0)
|
|
|
|
| 98 |
vc_submit = gr.Button("Convert", variant="primary")
|
| 99 |
vc_output1 = gr.Textbox(label="Output Message")
|
| 100 |
vc_output2 = gr.Audio(label="Output Audio")
|
|
|
|
| 38 |
|
| 39 |
|
| 40 |
hps = utils.get_hparams_from_file("configs/ljs_base.json")
|
| 41 |
+
hps_ms = utils.get_hparams_from_file("configs/config.json")
|
| 42 |
net_g_ms = SynthesizerTrn(
|
| 43 |
len(symbols),
|
| 44 |
hps_ms.data.filter_length // 2 + 1,
|
|
|
|
| 50 |
|
| 51 |
hubert = torch.hub.load("bshall/hubert:main", "hubert_soft")
|
| 52 |
|
| 53 |
+
_ = utils.load_checkpoint("G_18000.pth", net_g_ms, None)
|
| 54 |
|
| 55 |
def vc_fn(input_audio,vc_transform):
|
| 56 |
if input_audio is None:
|
|
|
|
| 77 |
print(sampling_rate)
|
| 78 |
f0 = resize2d(f0, len(soft[:, 0])) * vc_transform
|
| 79 |
soft[:, 0] = f0 / 10
|
| 80 |
+
sid = torch.LongTensor([int(vc_id)])
|
| 81 |
stn_tst = torch.FloatTensor(soft)
|
| 82 |
with torch.no_grad():
|
| 83 |
x_tst = stn_tst.unsqueeze(0)
|
|
|
|
| 95 |
with gr.TabItem("Basic"):
|
| 96 |
vc_input3 = gr.Audio(label="Input Audio (30s limitation)")
|
| 97 |
vc_transform = gr.Number(label="transform",value=1.0)
|
| 98 |
+
vc_id=gr.Textbox(lines=1, placeholder="speaker_id"),
|
| 99 |
vc_submit = gr.Button("Convert", variant="primary")
|
| 100 |
vc_output1 = gr.Textbox(label="Output Message")
|
| 101 |
vc_output2 = gr.Audio(label="Output Audio")
|