Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,6 +19,16 @@ tts = NeuTTSAir(
|
|
| 19 |
|
| 20 |
@spaces.GPU()
|
| 21 |
def infer(ref_text, ref_audio_path, gen_text):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
gr.Info("Starting inference request!")
|
| 24 |
gr.Info("Encoding reference...")
|
|
@@ -42,4 +52,4 @@ demo = gr.Interface(
|
|
| 42 |
)
|
| 43 |
|
| 44 |
if __name__ == "__main__":
|
| 45 |
-
demo.launch(allowed_paths=[SAMPLES_PATH],
|
|
|
|
| 19 |
|
| 20 |
@spaces.GPU()
|
| 21 |
def infer(ref_text, ref_audio_path, gen_text):
|
| 22 |
+
"""
|
| 23 |
+
Generates speech using NeuTTS-Air given a reference audio and text, and new text to synthesize.
|
| 24 |
+
|
| 25 |
+
Args:
|
| 26 |
+
ref_text (str): The text corresponding to the reference audio.
|
| 27 |
+
ref_audio_path (str): The file path to the reference audio.
|
| 28 |
+
gen_text (str): The new text to synthesize.
|
| 29 |
+
Returns:
|
| 30 |
+
tuple [int, np.ndarray]: A tuple containing the sample rate (24000) and the generated audio waveform as a numpy array.
|
| 31 |
+
"""
|
| 32 |
|
| 33 |
gr.Info("Starting inference request!")
|
| 34 |
gr.Info("Encoding reference...")
|
|
|
|
| 52 |
)
|
| 53 |
|
| 54 |
if __name__ == "__main__":
|
| 55 |
+
demo.launch(allowed_paths=[SAMPLES_PATH], mcp_server=True, inbrowser=True)
|