Spaces:
Runtime error
Runtime error
Commit
·
515a61a
1
Parent(s):
99cadae
Update app_multi.py
Browse files- app_multi.py +161 -159
app_multi.py
CHANGED
|
@@ -657,182 +657,184 @@ with app:
|
|
| 657 |
|
| 658 |
with gr.Row():
|
| 659 |
with gr.Tab('🎶 - 歌声转换'):
|
| 660 |
-
with gr.
|
| 661 |
-
|
| 662 |
-
|
| 663 |
-
|
| 664 |
-
|
| 665 |
-
|
| 666 |
-
|
| 667 |
-
|
| 668 |
-
|
| 669 |
-
|
| 670 |
-
|
| 671 |
-
value=0
|
| 672 |
-
)
|
| 673 |
-
f0_method = gr.Radio(
|
| 674 |
-
label='f0 methods',
|
| 675 |
-
choices=['pm', 'rmvpe'],
|
| 676 |
-
value='pm',
|
| 677 |
-
interactive=True
|
| 678 |
-
)
|
| 679 |
-
|
| 680 |
-
with gr.Accordion('更多设置', open=False):
|
| 681 |
-
feat_ratio = gr.Slider(
|
| 682 |
-
label='Feature ratio',
|
| 683 |
-
minimum=0,
|
| 684 |
-
maximum=1,
|
| 685 |
-
step=0.1,
|
| 686 |
-
value=0.6,
|
| 687 |
-
visible=False
|
| 688 |
-
)
|
| 689 |
-
filter_radius = gr.Slider(
|
| 690 |
-
label='Filter radius',
|
| 691 |
-
minimum=0,
|
| 692 |
-
maximum=7,
|
| 693 |
step=1,
|
| 694 |
-
value=
|
| 695 |
-
visible=False
|
| 696 |
)
|
| 697 |
-
|
| 698 |
-
label='
|
| 699 |
-
|
| 700 |
-
|
| 701 |
-
|
| 702 |
-
value=1,
|
| 703 |
-
visible=False
|
| 704 |
)
|
| 705 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 706 |
[
|
| 707 |
-
'
|
| 708 |
-
|
| 709 |
-
|
| 710 |
-
|
| 711 |
-
|
| 712 |
],
|
| 713 |
-
label='
|
| 714 |
-
|
| 715 |
)
|
| 716 |
-
|
| 717 |
-
|
| 718 |
-
|
| 719 |
-
|
| 720 |
-
|
| 721 |
-
|
| 722 |
-
|
| 723 |
-
m['metadata'].get('name')
|
| 724 |
)
|
| 725 |
-
|
| 726 |
-
|
| 727 |
-
label='
|
| 728 |
-
type='index'
|
| 729 |
-
)
|
| 730 |
-
|
| 731 |
-
# Model info
|
| 732 |
-
with gr.Box():
|
| 733 |
-
model_info = gr.Markdown(
|
| 734 |
-
'### AI歌手信息\n'
|
| 735 |
-
'Please select a model from dropdown above.',
|
| 736 |
-
elem_id='model_info'
|
| 737 |
-
)
|
| 738 |
-
|
| 739 |
-
output_audio = gr.Audio(label='AI歌手(无伴奏)', type="filepath")
|
| 740 |
-
output_msg = gr.Textbox(label='Output message')
|
| 741 |
|
| 742 |
with gr.Tab('🎙️ - 文本转语音'):
|
| 743 |
-
with gr.
|
| 744 |
-
|
| 745 |
-
|
| 746 |
-
|
| 747 |
-
|
| 748 |
-
|
| 749 |
-
|
| 750 |
-
|
| 751 |
-
s
|
| 752 |
-
|
| 753 |
-
|
| 754 |
-
|
| 755 |
-
|
| 756 |
-
|
| 757 |
-
|
| 758 |
-
|
| 759 |
-
|
| 760 |
-
tts_convert_btn = gr.Button('进行AI变声吧', variant='primary')
|
| 761 |
-
pitch_adjust = gr.Slider(
|
| 762 |
-
label='Pitch',
|
| 763 |
-
minimum=-24,
|
| 764 |
-
maximum=24,
|
| 765 |
-
step=1,
|
| 766 |
-
value=0
|
| 767 |
-
)
|
| 768 |
-
f0_method = gr.Radio(
|
| 769 |
-
label='f0 methods',
|
| 770 |
-
choices=['pm', 'rmvpe'],
|
| 771 |
-
value='pm',
|
| 772 |
-
interactive=True
|
| 773 |
-
)
|
| 774 |
-
|
| 775 |
-
with gr.Accordion('更多设置', open=False):
|
| 776 |
-
feat_ratio = gr.Slider(
|
| 777 |
-
label='Feature ratio',
|
| 778 |
-
minimum=0,
|
| 779 |
-
maximum=1,
|
| 780 |
-
step=0.1,
|
| 781 |
-
value=0.6,
|
| 782 |
-
visible=False
|
| 783 |
)
|
| 784 |
-
|
| 785 |
-
|
| 786 |
-
|
| 787 |
-
|
|
|
|
|
|
|
| 788 |
step=1,
|
| 789 |
-
value=
|
| 790 |
-
visible=False
|
| 791 |
)
|
| 792 |
-
|
| 793 |
-
label='
|
| 794 |
-
|
| 795 |
-
|
| 796 |
-
|
| 797 |
-
value=1,
|
| 798 |
-
visible=False
|
| 799 |
)
|
| 800 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 801 |
[
|
| 802 |
-
'
|
| 803 |
-
|
| 804 |
-
|
| 805 |
-
|
| 806 |
-
|
| 807 |
],
|
| 808 |
-
label='
|
| 809 |
-
|
| 810 |
)
|
| 811 |
-
|
| 812 |
-
|
| 813 |
-
|
| 814 |
-
|
| 815 |
-
|
| 816 |
-
|
| 817 |
-
|
| 818 |
-
m['metadata'].get('name')
|
| 819 |
)
|
| 820 |
-
|
| 821 |
-
|
| 822 |
-
label='
|
| 823 |
-
type='index'
|
| 824 |
-
)
|
| 825 |
-
|
| 826 |
-
# Model info
|
| 827 |
-
with gr.Box():
|
| 828 |
-
model_info = gr.Markdown(
|
| 829 |
-
'### AI歌手信息\n'
|
| 830 |
-
'Please select a model from dropdown above.',
|
| 831 |
-
elem_id='model_info'
|
| 832 |
-
)
|
| 833 |
-
|
| 834 |
-
output_audio = gr.Audio(label='AI歌手(无伴奏)', type="filepath")
|
| 835 |
-
output_msg = gr.Textbox(label='Output message')
|
| 836 |
|
| 837 |
with gr.Tab("📺 - 音乐视频"):
|
| 838 |
with gr.Row():
|
|
|
|
| 657 |
|
| 658 |
with gr.Row():
|
| 659 |
with gr.Tab('🎶 - 歌声转换'):
|
| 660 |
+
with gr.Row():
|
| 661 |
+
with gr.Column():
|
| 662 |
+
input_audio = as_audio_vocals
|
| 663 |
+
vc_convert_btn = gr.Button('进行歌声转换吧!', variant='primary')
|
| 664 |
+
full_song = gr.Button("加入歌曲伴奏吧!", variant="primary")
|
| 665 |
+
new_song = gr.Audio(label="AI歌手+伴奏", type="filepath")
|
| 666 |
+
|
| 667 |
+
pitch_adjust = gr.Slider(
|
| 668 |
+
label='Pitch',
|
| 669 |
+
minimum=-24,
|
| 670 |
+
maximum=24,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 671 |
step=1,
|
| 672 |
+
value=0
|
|
|
|
| 673 |
)
|
| 674 |
+
f0_method = gr.Radio(
|
| 675 |
+
label='f0 methods',
|
| 676 |
+
choices=['pm', 'rmvpe'],
|
| 677 |
+
value='pm',
|
| 678 |
+
interactive=True
|
|
|
|
|
|
|
| 679 |
)
|
| 680 |
+
|
| 681 |
+
with gr.Accordion('更多设置', open=False):
|
| 682 |
+
feat_ratio = gr.Slider(
|
| 683 |
+
label='Feature ratio',
|
| 684 |
+
minimum=0,
|
| 685 |
+
maximum=1,
|
| 686 |
+
step=0.1,
|
| 687 |
+
value=0.6,
|
| 688 |
+
visible=False
|
| 689 |
+
)
|
| 690 |
+
filter_radius = gr.Slider(
|
| 691 |
+
label='Filter radius',
|
| 692 |
+
minimum=0,
|
| 693 |
+
maximum=7,
|
| 694 |
+
step=1,
|
| 695 |
+
value=3,
|
| 696 |
+
visible=False
|
| 697 |
+
)
|
| 698 |
+
rms_mix_rate = gr.Slider(
|
| 699 |
+
label='Volume envelope mix rate',
|
| 700 |
+
minimum=0,
|
| 701 |
+
maximum=1,
|
| 702 |
+
step=0.1,
|
| 703 |
+
value=1,
|
| 704 |
+
visible=False
|
| 705 |
+
)
|
| 706 |
+
resample_rate = gr.Dropdown(
|
| 707 |
+
[
|
| 708 |
+
'Disable resampling',
|
| 709 |
+
'16000',
|
| 710 |
+
'22050',
|
| 711 |
+
'44100',
|
| 712 |
+
'48000'
|
| 713 |
+
],
|
| 714 |
+
label='Resample rate',
|
| 715 |
+
value='Disable resampling'
|
| 716 |
+
)
|
| 717 |
+
|
| 718 |
+
with gr.Column():
|
| 719 |
+
# Model select
|
| 720 |
+
model_index = gr.Dropdown(
|
| 721 |
[
|
| 722 |
+
'%s - %s' % (
|
| 723 |
+
m['metadata'].get('source', 'Unknown'),
|
| 724 |
+
m['metadata'].get('name')
|
| 725 |
+
)
|
| 726 |
+
for m in loaded_models
|
| 727 |
],
|
| 728 |
+
label='请选择您的AI歌手(必选)',
|
| 729 |
+
type='index'
|
| 730 |
)
|
| 731 |
+
|
| 732 |
+
# Model info
|
| 733 |
+
with gr.Box():
|
| 734 |
+
model_info = gr.Markdown(
|
| 735 |
+
'### AI歌手信息\n'
|
| 736 |
+
'Please select a model from dropdown above.',
|
| 737 |
+
elem_id='model_info'
|
|
|
|
| 738 |
)
|
| 739 |
+
|
| 740 |
+
output_audio = gr.Audio(label='AI歌手(无伴奏)', type="filepath")
|
| 741 |
+
output_msg = gr.Textbox(label='Output message')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 742 |
|
| 743 |
with gr.Tab('🎙️ - 文本转语音'):
|
| 744 |
+
with gr.Row():
|
| 745 |
+
with gr.Column():
|
| 746 |
+
tts_input = gr.Textbox(
|
| 747 |
+
label='请填写您想要转换的文本(中英皆可)',
|
| 748 |
+
lines=3
|
| 749 |
+
)
|
| 750 |
+
tts_speaker = gr.Dropdown(
|
| 751 |
+
[
|
| 752 |
+
'%s (%s)' % (
|
| 753 |
+
s['FriendlyName'],
|
| 754 |
+
s['Gender']
|
| 755 |
+
)
|
| 756 |
+
for s in tts_speakers_list
|
| 757 |
+
],
|
| 758 |
+
label='请选择一个相应语言的说话人',
|
| 759 |
+
type='index'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 760 |
)
|
| 761 |
+
|
| 762 |
+
tts_convert_btn = gr.Button('进行AI变声吧', variant='primary')
|
| 763 |
+
pitch_adjust = gr.Slider(
|
| 764 |
+
label='Pitch',
|
| 765 |
+
minimum=-24,
|
| 766 |
+
maximum=24,
|
| 767 |
step=1,
|
| 768 |
+
value=0
|
|
|
|
| 769 |
)
|
| 770 |
+
f0_method = gr.Radio(
|
| 771 |
+
label='f0 methods',
|
| 772 |
+
choices=['pm', 'rmvpe'],
|
| 773 |
+
value='pm',
|
| 774 |
+
interactive=True
|
|
|
|
|
|
|
| 775 |
)
|
| 776 |
+
|
| 777 |
+
with gr.Accordion('更多设置', open=False):
|
| 778 |
+
feat_ratio = gr.Slider(
|
| 779 |
+
label='Feature ratio',
|
| 780 |
+
minimum=0,
|
| 781 |
+
maximum=1,
|
| 782 |
+
step=0.1,
|
| 783 |
+
value=0.6,
|
| 784 |
+
visible=False
|
| 785 |
+
)
|
| 786 |
+
filter_radius = gr.Slider(
|
| 787 |
+
label='Filter radius',
|
| 788 |
+
minimum=0,
|
| 789 |
+
maximum=7,
|
| 790 |
+
step=1,
|
| 791 |
+
value=3,
|
| 792 |
+
visible=False
|
| 793 |
+
)
|
| 794 |
+
rms_mix_rate = gr.Slider(
|
| 795 |
+
label='Volume envelope mix rate',
|
| 796 |
+
minimum=0,
|
| 797 |
+
maximum=1,
|
| 798 |
+
step=0.1,
|
| 799 |
+
value=1,
|
| 800 |
+
visible=False
|
| 801 |
+
)
|
| 802 |
+
resample_rate = gr.Dropdown(
|
| 803 |
+
[
|
| 804 |
+
'Disable resampling',
|
| 805 |
+
'16000',
|
| 806 |
+
'22050',
|
| 807 |
+
'44100',
|
| 808 |
+
'48000'
|
| 809 |
+
],
|
| 810 |
+
label='Resample rate',
|
| 811 |
+
value='Disable resampling'
|
| 812 |
+
)
|
| 813 |
+
|
| 814 |
+
with gr.Column():
|
| 815 |
+
# Model select
|
| 816 |
+
model_index = gr.Dropdown(
|
| 817 |
[
|
| 818 |
+
'%s - %s' % (
|
| 819 |
+
m['metadata'].get('source', 'Unknown'),
|
| 820 |
+
m['metadata'].get('name')
|
| 821 |
+
)
|
| 822 |
+
for m in loaded_models
|
| 823 |
],
|
| 824 |
+
label='请选择您的AI歌手(必选)',
|
| 825 |
+
type='index'
|
| 826 |
)
|
| 827 |
+
|
| 828 |
+
# Model info
|
| 829 |
+
with gr.Box():
|
| 830 |
+
model_info = gr.Markdown(
|
| 831 |
+
'### AI歌手信息\n'
|
| 832 |
+
'Please select a model from dropdown above.',
|
| 833 |
+
elem_id='model_info'
|
|
|
|
| 834 |
)
|
| 835 |
+
|
| 836 |
+
output_audio = gr.Audio(label='AI歌手(无伴奏)', type="filepath")
|
| 837 |
+
output_msg = gr.Textbox(label='Output message')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 838 |
|
| 839 |
with gr.Tab("📺 - 音乐视频"):
|
| 840 |
with gr.Row():
|