Update app.py
Browse files78 unmodified lines7980818283848541 unmodified lines12712812913013113213313413513620 unmodified lines15715815916016116216378 unmodified linestone_color_converter.load_ckpt(f'{ckpt_converter_en}/checkpoint.pth')def generate_audio(text, audio_ref, style_mode, temperature, top_P, top_K, audio_seed_input, text_seed_input, refine_text_flag, refine_text_input):if style_mode=="default":source_se = torch.load(f'{ckpt_base_en}/en_default_se.pth').to(device)reference_speaker = audio_ref41 unmodified linesdefault_text = "Today a man knocked on my door and asked for a small donation toward the local swimming pool. I gave him a glass of water."text_input = gr.Textbox(label="Input Text", lines=4, placeholder="Please Input Text...", value=default_text)default_refine_text = "[oral_2][laugh_0][break_6]"refine_text_checkbox = gr.Checkbox(label="Refine text:'oral' means add filler words, 'laugh' means add laughter, and 'break' means add a pause. (0-10) ", value=True)refine_text_input = gr.Textbox(label="Refine Prompt", lines=1, placeholder="Please Refine Prompt...", value=default_refine_text)with gr.Row():temperature_slider = gr.Slider(minimum=0.00001, maximum=1.0, step=0.00001, value=0.3, label="Audio temperature")20 unmodified linesoutputs=text_seed_input)generate_button.click(generate_audio,inputs=[text_input, temperature_slider, top_p_slider, top_k_slider, audio_seed_input, text_seed_input, refine_text_checkbox, refine_text_input],outputs=audio_output)parser = argparse.ArgumentParser(description='ChatTTS demo Launch')78 unmodified lines7980818283848541 unmodified lines12712812913013113213313413513613713813920 unmodified lines16016116216316416516678 unmodified linestone_color_converter.load_ckpt(f'{ckpt_converter_en}/checkpoint.pth')def generate_audio(text, audio_ref, temperature, top_P, top_K, audio_seed_input, text_seed_input, refine_text_flag, refine_text_input):if style_mode=="default":source_se = torch.load(f'{ckpt_base_en}/en_default_se.pth').to(device)reference_speaker = audio_ref41 unmodified linesdefault_text = "Today a man knocked on my door and asked for a small donation toward the local swimming pool. I gave him a glass of water."text_input = gr.Textbox(label="Input Text", lines=4, placeholder="Please Input Text...", value=default_text)default_refine_text = "[oral_2][laugh_0][break_6]"refine_text_checkbox = gr.Checkbox(label="Refine text:'oral' means add filler words, 'laugh' means add laughter, and 'break' means add a pause. (0-10) ", value=True)refine_text_input = gr.Textbox(label="Refine Prompt", lines=1, placeholder="Please Refine Prompt...", value=default_refine_text)with gr.Column():clone_voice = gr.Audio(label="请上传您喜欢的语音文件", type="filepath")with gr.Row():temperature_slider = gr.Slider(minimum=0.00001, maximum=1.0, step=0.00001, value=0.3, label="Audio temperature")20 unmodified linesoutputs=text_seed_input)generate_button.click(generate_audio,inputs=[text_input, clone_voice, temperature_slider, top_p_slider, top_k_slider, audio_seed_input, text_seed_input, refine_text_checkbox, refine_text_input],outputs=audio_output)parser = argparse.ArgumentParser(description='ChatTTS demo Launch')
app.py+6-3