Ailyth commited on
Commit
63f3c41
1 Parent(s): 16eca8e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -32
app.py CHANGED
@@ -115,56 +115,31 @@ if __name__ == "__main__":
115
  speaker = list(speaker_ids.keys())[0]
116
 
117
  css='''
118
- @keyframes scanline {0.01% {
119
- height: 0;
120
- }
121
- 99.99% {
122
- height: 100%
123
- }
124
- 100% {
125
- height: 0;
126
- }
127
- }
128
-
129
-
130
- .scanline {
131
- position: fixed;
132
- top: 0;
133
- left: 0;
134
- right: 0;
135
- bottom: 0;
136
- background: rgba(255,255,255,0.02);
137
- animation: scanline 8s linear infinite;
138
- pointer-events: none;
139
- }
140
-
141
- #main {background-color: darken(red, 47%);
142
- background-size: 100px;
143
- color: red;
144
- height: 100%;};
145
  #elements {background-color:transparent;}
146
  #btn {border: 2px solid #3ed6e500; margin-left: auto; margin-right: auto;background-color:#3ed6e500;border-radius: 5px;
147
  :hover{color: #92ccd8; } }
148
  '''
149
 
150
  with gr.Blocks(css=css) as app:
151
- with gr.Row(elem_id="main",elem_classes="scanline"):
152
  with gr.Column():
153
 
154
  gr.Markdown("测试用")
155
  text = gr.TextArea(label="Text", placeholder="Input Text Here",
156
  value="在不在?能不能借给我三百块钱买可乐",
157
- info="使用huggingface的免费CPU进行推理,因此速度不快,一次性不要输入超过500汉字")
158
- model = gr.Radio(choices=list(models.keys()), value=list(models.keys())[0], label='音声模型')
 
159
  #model = gr.Dropdown(choices=models,value=models[0], label='音声模型')
160
  #speaker = gr.Radio(choices=speakers, value=speakers[0], label='Speaker')
161
  gr.Markdown(value="生成参数")
162
- sdp_ratio = gr.Slider(minimum=0, maximum=1, value=0.2, step=0.01, label='语调变化')
163
  noise_scale = gr.Slider(minimum=0.1, maximum=1.5, value=0.5, step=0.01, label='感情变化')
164
  noise_scale_w = gr.Slider(minimum=0.1, maximum=1.4, value=0.9, step=0.01, label='音节长度')
165
  length_scale = gr.Slider(minimum=0.1, maximum=2, value=1, step=0.01, label='生成语音总长度')
166
  btn = gr.Button("生成", variant="primary",elem_id="btn")
167
- with gr.Column():
168
  text_output = gr.Textbox(label="Message")
169
  audio_output = gr.Audio(label="试听")
170
  MP3_output = gr.File(label="下载")
 
115
  speaker = list(speaker_ids.keys())[0]
116
 
117
  css='''
118
+ #main {background-color: background-image: linear-gradient(to top, #050e15, #13182a, #2f1a37, #501737, #6b1627)};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  #elements {background-color:transparent;}
120
  #btn {border: 2px solid #3ed6e500; margin-left: auto; margin-right: auto;background-color:#3ed6e500;border-radius: 5px;
121
  :hover{color: #92ccd8; } }
122
  '''
123
 
124
  with gr.Blocks(css=css) as app:
125
+ with gr.Row(elem_id="main"):
126
  with gr.Column():
127
 
128
  gr.Markdown("测试用")
129
  text = gr.TextArea(label="Text", placeholder="Input Text Here",
130
  value="在不在?能不能借给我三百块钱买可乐",
131
+ info="使用huggingface的免费CPU进行推理,因此速度不快,一次性不要输入超过500汉字",
132
+ elem_id="elements" )
133
+ model = gr.Radio(choices=list(models.keys()), value=list(models.keys())[0], label='音声模型',elem_id="elements")
134
  #model = gr.Dropdown(choices=models,value=models[0], label='音声模型')
135
  #speaker = gr.Radio(choices=speakers, value=speakers[0], label='Speaker')
136
  gr.Markdown(value="生成参数")
137
+ sdp_ratio = gr.Slider(minimum=0, maximum=1, value=0.2, step=0.01, label='语调变化',elem_id="elements")
138
  noise_scale = gr.Slider(minimum=0.1, maximum=1.5, value=0.5, step=0.01, label='感情变化')
139
  noise_scale_w = gr.Slider(minimum=0.1, maximum=1.4, value=0.9, step=0.01, label='音节长度')
140
  length_scale = gr.Slider(minimum=0.1, maximum=2, value=1, step=0.01, label='生成语音总长度')
141
  btn = gr.Button("生成", variant="primary",elem_id="btn")
142
+ with gr.Column(elem_id="elements"):
143
  text_output = gr.Textbox(label="Message")
144
  audio_output = gr.Audio(label="试听")
145
  MP3_output = gr.File(label="下载")