Spaces:
Sleeping
Sleeping
hritiksdlccorp
commited on
Commit
•
b21b2eb
1
Parent(s):
1cc0836
Update app.py
Browse files
app.py
CHANGED
@@ -760,26 +760,16 @@ for model_name, model_info in models.items():
|
|
760 |
|
761 |
##########GRADIO###########
|
762 |
|
|
|
763 |
with gr.Blocks(theme='Kasien/ali_theme_custom') as app:
|
764 |
gr.HTML('''
|
765 |
-
<h1 style="font-size: 25px;">
|
766 |
-
|
767 |
-
|
768 |
-
|
|
|
769 |
</p>''')
|
770 |
|
771 |
-
gr.Markdown("""* This space is based on the text-to-speech generation solution [GPT-SoVITS](https://github.com/RVC-Boss/GPT-SoVITS) .
|
772 |
-
You can visit the repo's github homepage to learn training and inference.<br>
|
773 |
-
本空间基于文字转语音生成方案 [GPT-SoVITS](https://github.com/RVC-Boss/GPT-SoVITS). 你可以前往项目的github主页学习如何推理和训练。
|
774 |
-
* ⚠️Generating voice is very slow due to using HuggingFace's free CPU in this space.
|
775 |
-
For faster generation, click the Colab icon below to use this space in Colab,
|
776 |
-
which will significantly improve the speed.<br>
|
777 |
-
由于本空间使用huggingface的免费CPU进行推理,因此速度很慢,如想快速生成,请点击下方的Colab图标,
|
778 |
-
前往Colab使用已获得更快的生成速度。
|
779 |
-
<br>Colabの使用を強くお勧めします。より速い生成速度が得られます。
|
780 |
-
* each model can speak three languages.<br>每个模型都能说三种语言<br>各モデルは3つの言語を話すことができます。""")
|
781 |
-
gr.HTML('''<a href="https://colab.research.google.com/drive/1fTuPZ4tZsAjS-TrhQWMCb7KRdnU8aF6j" target="_blank"><img src="https://camo.githubusercontent.com/dd83d4a334eab7ada034c13747d9e2237182826d32e3fda6629740b6e02f18d8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6c61622d4639414230303f7374796c653d666f722d7468652d6261646765266c6f676f3d676f6f676c65636f6c616226636f6c6f723d353235323532" alt="colab"></a>
|
782 |
-
''')
|
783 |
|
784 |
default_voice_wav, default_voice_wav_words, default_language, _, default_model_name, _, default_tone_sample_path = update_model("Trump")
|
785 |
english_models = [name for name, _ in models_by_language["English"]]
|
@@ -791,22 +781,17 @@ with gr.Blocks(theme='Kasien/ali_theme_custom') as app:
|
|
791 |
japanese_choice = gr.Radio(japanese_models, label="JA",scale=4)
|
792 |
|
793 |
plsh='''
|
794 |
-
|
795 |
-
|
796 |
-
If you don't know what to input, you can click the dice on the right, and random text will appear.
|
797 |
-
如果你不知道输入什么,可以点击右边的骰子,会出现随机文本。
|
798 |
-
入力するものがわからない場合は、右側のサイコロをクリックすると、ランダムなテキストが表示されます。
|
799 |
-
|
800 |
'''
|
801 |
limit='Max 70 words. Excess will be ignored./单次最多处理120字左右,多余的会被忽略'
|
802 |
|
803 |
gr.HTML('''
|
804 |
-
<b>Input Text
|
805 |
with gr.Row():
|
806 |
with gr.Column(scale=2):
|
807 |
-
model_name = gr.Textbox(label="Seleted Model
|
808 |
text_language = gr.Textbox(
|
809 |
-
label="Language for input text
|
810 |
info='Automatic detection of input language type.',scale=1,interactive=False
|
811 |
)
|
812 |
text = gr.Textbox(label="INPUT TEXT", lines=5,placeholder=plsh,info=limit,scale=10,min_width=0)
|
@@ -819,11 +804,11 @@ with gr.Blocks(theme='Kasien/ali_theme_custom') as app:
|
|
819 |
with gr.Row():
|
820 |
with gr.Column(scale=2):
|
821 |
tone_select = gr.Radio(
|
822 |
-
label="Select Tone
|
823 |
choices=["tone1","tone2","tone3"],
|
824 |
value="tone1",
|
825 |
info='Tone influences the emotional expression ',scale=1)
|
826 |
-
tone_sample=gr.Audio(label="🔊Preview tone
|
827 |
|
828 |
|
829 |
with gr.Accordion(label="prpt voice", open=False,visible=False):
|
@@ -834,7 +819,7 @@ with gr.Blocks(theme='Kasien/ali_theme_custom') as app:
|
|
834 |
dummy = gr.Radio(choices=["中文","English","日本語"],visible=False)
|
835 |
|
836 |
|
837 |
-
with gr.Accordion(label="Additional generation options
|
838 |
how_to_cut = gr.Dropdown(
|
839 |
label=("How to split?"),
|
840 |
choices=[("Do not split"), ("Split into groups of 4 sentences"), ("Split every 50 characters"),
|
@@ -843,35 +828,34 @@ with gr.Blocks(theme='Kasien/ali_theme_custom') as app:
|
|
843 |
interactive=True,
|
844 |
info='A suitable splitting method can achieve better generation results'
|
845 |
)
|
846 |
-
volume = gr.Slider(minimum=0.5, maximum=2, value=1, step=0.01, label='Volume
|
847 |
|
848 |
|
849 |
gr.HTML('''
|
850 |
-
<b>Generate Voice
|
851 |
with gr.Row():
|
852 |
main_button = gr.Button("✨Generate Voice", variant="primary", scale=2)
|
853 |
output = gr.Audio(label="💾Download it by clicking ⬇️", scale=6)
|
854 |
#info = gr.Textbox(label="INFO", visible=True, readonly=True, scale=1)
|
855 |
|
856 |
gr.HTML('''
|
857 |
-
Generation is slower, please be patient and wait
|
858 |
-
If it generated silence, please try again
|
859 |
<br><br><br><br>
|
860 |
-
<h1 style="font-size: 25px;">Clone custom Voice
|
861 |
<p style="margin-bottom: 10px; font-size: 100%">
|
862 |
-
|
863 |
Requires 3-10 seconds of voice input. The cloned voice will have a similarity of 80% or above compared to the original.<br>
|
864 |
-
|
865 |
-
|
866 |
|
867 |
</p>''')
|
868 |
|
869 |
with gr.Row():
|
870 |
-
user_voice = gr.Audio(type="filepath", label="(3~10s)Upload or Record audio
|
871 |
with gr.Column(scale=7):
|
872 |
-
user_lang = gr.Textbox(label="Language
|
873 |
with gr.Row():
|
874 |
-
user_text= gr.Textbox(label="Text for generation
|
875 |
dddice= gr.Button('🎲', variant='tool',min_width=0,scale=0)
|
876 |
|
877 |
dddice.click(dice, outputs=[user_text, dddice])
|
|
|
760 |
|
761 |
##########GRADIO###########
|
762 |
|
763 |
+
|
764 |
with gr.Blocks(theme='Kasien/ali_theme_custom') as app:
|
765 |
gr.HTML('''
|
766 |
+
<h1 style="font-size: 25px;">Text-to-Speech Generator</h1>
|
767 |
+
<h1 style="font-size: 20px;">Supports English</h1>
|
768 |
+
<p style="margin-bottom: 10px; font-size: 100%">
|
769 |
+
Welcome to our Text-to-Speech generator! This tool converts written text into natural sounding audio in English. Perfect for presentations, educational content, or just having fun, it allows you to bring text to life effortlessly. Utilize the various voice options and tones to tailor your audio outputs according to your needs.
|
770 |
+
</p>
|
771 |
</p>''')
|
772 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
773 |
|
774 |
default_voice_wav, default_voice_wav_words, default_language, _, default_model_name, _, default_tone_sample_path = update_model("Trump")
|
775 |
english_models = [name for name, _ in models_by_language["English"]]
|
|
|
781 |
japanese_choice = gr.Radio(japanese_models, label="JA",scale=4)
|
782 |
|
783 |
plsh='''
|
784 |
+
Input any text
|
|
|
|
|
|
|
|
|
|
|
785 |
'''
|
786 |
limit='Max 70 words. Excess will be ignored./单次最多处理120字左右,多余的会被忽略'
|
787 |
|
788 |
gr.HTML('''
|
789 |
+
<b>Input Text</b>''')
|
790 |
with gr.Row():
|
791 |
with gr.Column(scale=2):
|
792 |
+
model_name = gr.Textbox(label="Seleted Model", value=default_model_name, interactive=False,scale=1,)
|
793 |
text_language = gr.Textbox(
|
794 |
+
label="Language for input text",
|
795 |
info='Automatic detection of input language type.',scale=1,interactive=False
|
796 |
)
|
797 |
text = gr.Textbox(label="INPUT TEXT", lines=5,placeholder=plsh,info=limit,scale=10,min_width=0)
|
|
|
804 |
with gr.Row():
|
805 |
with gr.Column(scale=2):
|
806 |
tone_select = gr.Radio(
|
807 |
+
label="Select Tone",
|
808 |
choices=["tone1","tone2","tone3"],
|
809 |
value="tone1",
|
810 |
info='Tone influences the emotional expression ',scale=1)
|
811 |
+
tone_sample=gr.Audio(label="🔊Preview tone ", scale=8)
|
812 |
|
813 |
|
814 |
with gr.Accordion(label="prpt voice", open=False,visible=False):
|
|
|
819 |
dummy = gr.Radio(choices=["中文","English","日本語"],visible=False)
|
820 |
|
821 |
|
822 |
+
with gr.Accordion(label="Additional generation options", open=False):
|
823 |
how_to_cut = gr.Dropdown(
|
824 |
label=("How to split?"),
|
825 |
choices=[("Do not split"), ("Split into groups of 4 sentences"), ("Split every 50 characters"),
|
|
|
828 |
interactive=True,
|
829 |
info='A suitable splitting method can achieve better generation results'
|
830 |
)
|
831 |
+
volume = gr.Slider(minimum=0.5, maximum=2, value=1, step=0.01, label='Volume')
|
832 |
|
833 |
|
834 |
gr.HTML('''
|
835 |
+
<b>Generate Voice</b>''')
|
836 |
with gr.Row():
|
837 |
main_button = gr.Button("✨Generate Voice", variant="primary", scale=2)
|
838 |
output = gr.Audio(label="💾Download it by clicking ⬇️", scale=6)
|
839 |
#info = gr.Textbox(label="INFO", visible=True, readonly=True, scale=1)
|
840 |
|
841 |
gr.HTML('''
|
842 |
+
Generation is slower, please be patient and wait<br>
|
843 |
+
If it generated silence, please try again.
|
844 |
<br><br><br><br>
|
845 |
+
<h1 style="font-size: 25px;">Clone custom Voice</h1>
|
846 |
<p style="margin-bottom: 10px; font-size: 100%">
|
847 |
+
<br>
|
848 |
Requires 3-10 seconds of voice input. The cloned voice will have a similarity of 80% or above compared to the original.<br>
|
849 |
+
|
|
|
850 |
|
851 |
</p>''')
|
852 |
|
853 |
with gr.Row():
|
854 |
+
user_voice = gr.Audio(type="filepath", label="(3~10s)Upload or Record audio",scale=3)
|
855 |
with gr.Column(scale=7):
|
856 |
+
user_lang = gr.Textbox(label="Language",info='Automatic detection of input language type.',interactive=False)
|
857 |
with gr.Row():
|
858 |
+
user_text= gr.Textbox(label="Text for generation", lines=5,placeholder=plsh,info=limit)
|
859 |
dddice= gr.Button('🎲', variant='tool',min_width=0,scale=0)
|
860 |
|
861 |
dddice.click(dice, outputs=[user_text, dddice])
|