Spaces:
Runtime error
Runtime error
junhyouk lee commited on
Commit ·
54fb9ea
1
Parent(s): 028b554
inputs problem
Browse files
app.py
CHANGED
|
@@ -49,6 +49,8 @@ class GradioApp:
|
|
| 49 |
|
| 50 |
@torch.no_grad()
|
| 51 |
def inference(self, text, speaker_id_val, seed, scope_shift, duration):
|
|
|
|
|
|
|
| 52 |
torch.manual_seed(seed)
|
| 53 |
text_norm, tone, phones = self.get_phoneme(text)
|
| 54 |
x_tst = text_norm.to(self.device).unsqueeze(0)
|
|
@@ -72,7 +74,7 @@ class GradioApp:
|
|
| 72 |
|
| 73 |
def _gradio_interface(self):
|
| 74 |
title = "PITS Demo"
|
| 75 |
-
inputs = [
|
| 76 |
gr.Textbox(label="Text (150 words limitation)",
|
| 77 |
value="This is demo page.",
|
| 78 |
elem_id="tts-input"),
|
|
@@ -85,7 +87,7 @@ class GradioApp:
|
|
| 85 |
gr.Slider(0.5, 2., value=1., step=0.1,
|
| 86 |
label="duration multiplier"),
|
| 87 |
]
|
| 88 |
-
outputs = [
|
| 89 |
gr.Textbox(label="Phonemes"),
|
| 90 |
gr.Audio(type="numpy", label="Output audio")
|
| 91 |
]
|
|
@@ -94,8 +96,8 @@ class GradioApp:
|
|
| 94 |
examples = [["This is a demo page of the PITS."],["I love hugging face."]]
|
| 95 |
return gr.Interface(
|
| 96 |
fn=self.inference,
|
| 97 |
-
inputs=inputs,
|
| 98 |
-
outputs=outputs,
|
| 99 |
title=title,
|
| 100 |
description=description,
|
| 101 |
article=article,
|
|
|
|
| 49 |
|
| 50 |
@torch.no_grad()
|
| 51 |
def inference(self, text, speaker_id_val, seed, scope_shift, duration):
|
| 52 |
+
seed = int(seed)
|
| 53 |
+
scope_shift = int(scope_shift)
|
| 54 |
torch.manual_seed(seed)
|
| 55 |
text_norm, tone, phones = self.get_phoneme(text)
|
| 56 |
x_tst = text_norm.to(self.device).unsqueeze(0)
|
|
|
|
| 74 |
|
| 75 |
def _gradio_interface(self):
|
| 76 |
title = "PITS Demo"
|
| 77 |
+
self.inputs = [
|
| 78 |
gr.Textbox(label="Text (150 words limitation)",
|
| 79 |
value="This is demo page.",
|
| 80 |
elem_id="tts-input"),
|
|
|
|
| 87 |
gr.Slider(0.5, 2., value=1., step=0.1,
|
| 88 |
label="duration multiplier"),
|
| 89 |
]
|
| 90 |
+
self.outputs = [
|
| 91 |
gr.Textbox(label="Phonemes"),
|
| 92 |
gr.Audio(type="numpy", label="Output audio")
|
| 93 |
]
|
|
|
|
| 96 |
examples = [["This is a demo page of the PITS."],["I love hugging face."]]
|
| 97 |
return gr.Interface(
|
| 98 |
fn=self.inference,
|
| 99 |
+
inputs=self.inputs,
|
| 100 |
+
outputs=self.outputs,
|
| 101 |
title=title,
|
| 102 |
description=description,
|
| 103 |
article=article,
|