product2204
commited on
Commit
•
84a73f0
1
Parent(s):
29fab81
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
-
from TTS.api import TTS
|
4 |
import os
|
5 |
from datetime import datetime
|
6 |
|
@@ -36,12 +36,12 @@ def tts_process(transcript_file, voice_file):
|
|
36 |
|
37 |
# Gradio interface setup
|
38 |
iface = gr.Interface(fn=tts_process,
|
39 |
-
inputs=[gr.
|
40 |
-
gr.
|
41 |
-
outputs=gr.
|
42 |
title="TTS Voice Cloning",
|
43 |
description="Upload a transcript text file and a voice file to clone the voice and generate speech.")
|
44 |
|
45 |
# Execute only if run as a script
|
46 |
-
if __name__ == "
|
47 |
iface.launch(share=True)
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
+
from TTS.api import TTS # Ensure this import matches your TTS library
|
4 |
import os
|
5 |
from datetime import datetime
|
6 |
|
|
|
36 |
|
37 |
# Gradio interface setup
|
38 |
iface = gr.Interface(fn=tts_process,
|
39 |
+
inputs=[gr.UploadButton("Click to Upload a Transcript (.txt) File", file_types=["text"]),
|
40 |
+
gr.UploadButton("Click to Upload a Voice to be Cloned (.mp3) File", file_types=["audio"])],
|
41 |
+
outputs=gr.File(label="Download Speech Output"),
|
42 |
title="TTS Voice Cloning",
|
43 |
description="Upload a transcript text file and a voice file to clone the voice and generate speech.")
|
44 |
|
45 |
# Execute only if run as a script
|
46 |
+
if __name__ == "__main__":
|
47 |
iface.launch(share=True)
|