Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -116,7 +116,15 @@ function readfn(inn, url_in, payload) {
|
|
116 |
}
|
117 |
</script>
|
118 |
"""
|
119 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
def search(q,rn,st,names,length,noise,width,sen_pause):
|
121 |
payload={
|
122 |
"model": names,
|
@@ -172,12 +180,13 @@ with gr.Blocks(css=style,head=head) as b:
|
|
172 |
with gr.Column(scale=3):
|
173 |
query=gr.Textbox(label="Query",info="Search arXiv papers")
|
174 |
sub=gr.Button(elem_id='big_btn')
|
175 |
-
with gr.Accordion("Voice Controls"):
|
176 |
names=gr.Dropdown(choices=pp.key_list,value="en_US-lessac-high")
|
177 |
length=gr.Slider(label="Length", minimum=0.01, maximum=10.0, value=1)
|
178 |
noise=gr.Slider(label="Noise", minimum=0.01, maximum=3.0, value=0.5)
|
179 |
width=gr.Slider(label="Noise Width", minimum=0.01, maximum=3.0, value=0.5)
|
180 |
sen_pause=gr.Slider(label="Sentence Pause", minimum=0.1, maximum=10.0, value=1)
|
|
|
181 |
with gr.Group():
|
182 |
with gr.Row():
|
183 |
prev_btn=gr.Button("Previous",interactive=False)
|
@@ -194,6 +203,6 @@ with gr.Blocks(css=style,head=head) as b:
|
|
194 |
|
195 |
next_btn.click(next_show,[hid_start],[prev_btn,hid_start]).then(show_num,hid_start,show_html).then(search,[query,num,hid_start],[html_out])
|
196 |
prev_btn.click(prev_show,[hid_start],[prev_btn,hid_start]).then(show_num,hid_start,show_html).then(search,[query,num,hid_start],[html_out])
|
197 |
-
|
198 |
sub.click(search,[query,num,hid_start,names,length,noise,width,sen_pause],[html_out]).then(show_num,hid_start,show_html)
|
199 |
b.queue(default_concurrency_limit=20).launch(max_threads=40)
|
|
|
116 |
}
|
117 |
</script>
|
118 |
"""
|
119 |
+
def update_voice(names,length,noise,width,sen_pause):
|
120 |
+
payload={
|
121 |
+
"model": names,
|
122 |
+
"length": length,
|
123 |
+
"noise": noise,
|
124 |
+
"width": width,
|
125 |
+
"pause": sen_pause
|
126 |
+
}
|
127 |
+
return payload
|
128 |
def search(q,rn,st,names,length,noise,width,sen_pause):
|
129 |
payload={
|
130 |
"model": names,
|
|
|
180 |
with gr.Column(scale=3):
|
181 |
query=gr.Textbox(label="Query",info="Search arXiv papers")
|
182 |
sub=gr.Button(elem_id='big_btn')
|
183 |
+
with gr.Accordion("Voice Controls",open=False):
|
184 |
names=gr.Dropdown(choices=pp.key_list,value="en_US-lessac-high")
|
185 |
length=gr.Slider(label="Length", minimum=0.01, maximum=10.0, value=1)
|
186 |
noise=gr.Slider(label="Noise", minimum=0.01, maximum=3.0, value=0.5)
|
187 |
width=gr.Slider(label="Noise Width", minimum=0.01, maximum=3.0, value=0.5)
|
188 |
sen_pause=gr.Slider(label="Sentence Pause", minimum=0.1, maximum=10.0, value=1)
|
189 |
+
upd_btn=gr.Button("Update")
|
190 |
with gr.Group():
|
191 |
with gr.Row():
|
192 |
prev_btn=gr.Button("Previous",interactive=False)
|
|
|
203 |
|
204 |
next_btn.click(next_show,[hid_start],[prev_btn,hid_start]).then(show_num,hid_start,show_html).then(search,[query,num,hid_start],[html_out])
|
205 |
prev_btn.click(prev_show,[hid_start],[prev_btn,hid_start]).then(show_num,hid_start,show_html).then(search,[query,num,hid_start],[html_out])
|
206 |
+
upd_btn.click(search,[query,num,hid_start,names,length,noise,width,sen_pause],[html_out])
|
207 |
sub.click(search,[query,num,hid_start,names,length,noise,width,sen_pause],[html_out]).then(show_num,hid_start,show_html)
|
208 |
b.queue(default_concurrency_limit=20).launch(max_threads=40)
|