Kevin676 commited on
Commit
9b47c80
1 Parent(s): 15706b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +41 -7
app.py CHANGED
@@ -170,11 +170,11 @@ def evaluate(
170
  return [result.text, output.split("### Response:")[1].strip(), "enhanced.wav"]
171
 
172
 
173
- g = gr.Interface(
174
  fn=evaluate,
175
  inputs=[
176
- gr.Audio(source="microphone", label = "请开始对话吧!", type="filepath"),
177
- gr.Audio(source="upload", label = "请上传您喜欢的声音(wav文件)", type="filepath"),
178
  gr.components.Textbox(lines=2, label="Input", placeholder="none"),
179
  gr.components.Slider(minimum=0, maximum=1, value=0.1, label="Temperature"),
180
  gr.components.Slider(minimum=0, maximum=1, value=0.75, label="Top p"),
@@ -195,12 +195,46 @@ g = gr.Interface(
195
  ),
196
  gr.Audio(label="Audio with Custom Voice"),
197
  ],
198
- title="🥳💬💕 - TalktoAI,随时随地,谈天说地!",
199
  description="🤖 - 让有人文关怀的AI造福每一个人!AI向善,文明璀璨!TalktoAI - Enable the future!",
200
- article = "Powered by [Alpaca-LoRA](https://github.com/tloen/alpaca-lora). Credit: tloen[https://github.com/tloen]."
201
  )
202
- g.queue(concurrency_count=1)
203
- g.launch(show_error = True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
 
205
  # Old testing code follows.
206
 
 
170
  return [result.text, output.split("### Response:")[1].strip(), "enhanced.wav"]
171
 
172
 
173
+ c1 = gr.Interface(
174
  fn=evaluate,
175
  inputs=[
176
+ gr.Audio(source="microphone", label = "请开始对话吧!TalktoAI!", type="filepath"),
177
+ gr.Audio(source="upload", label = "请上传您喜欢的声音(wav/mp3文件)", type="filepath"),
178
  gr.components.Textbox(lines=2, label="Input", placeholder="none"),
179
  gr.components.Slider(minimum=0, maximum=1, value=0.1, label="Temperature"),
180
  gr.components.Slider(minimum=0, maximum=1, value=0.75, label="Top p"),
 
195
  ),
196
  gr.Audio(label="Audio with Custom Voice"),
197
  ],
198
+ # title="🥳💬💕 - TalktoAI,随时随地,谈天说地!",
199
  description="🤖 - 让有人文关怀的AI造福每一个人!AI向善,文明璀璨!TalktoAI - Enable the future!",
200
+ article = "Powered by [Alpaca-LoRA](https://github.com/tloen/alpaca-lora). Credit: tloen[https://github.com/tloen].",
201
  )
202
+
203
+
204
+ c2 = gr.Interface(
205
+ fn=evaluate,
206
+ inputs=[
207
+ gr.Audio(source="microphone", label = "请开始对话吧!TalktoAI!", type="filepath"),
208
+ gr.Audio(source="microphone", label = "请上传您喜欢的声音,并尽量避免噪音", type="filepath"),
209
+ gr.components.Textbox(lines=2, label="Input", placeholder="none"),
210
+ gr.components.Slider(minimum=0, maximum=1, value=0.1, label="Temperature"),
211
+ gr.components.Slider(minimum=0, maximum=1, value=0.75, label="Top p"),
212
+ gr.components.Slider(minimum=0, maximum=100, step=1, value=40, label="Top k"),
213
+ gr.components.Slider(minimum=1, maximum=4, step=1, value=4, label="Beams"),
214
+ gr.components.Slider(
215
+ minimum=1, maximum=512, step=1, value=128, label="Max tokens"
216
+ ),
217
+ ],
218
+ outputs=[
219
+ gr.inputs.Textbox(
220
+ lines=2,
221
+ label="Speech to Text",
222
+ ),
223
+ gr.inputs.Textbox(
224
+ lines=5,
225
+ label="Alpaca-LoRA Output",
226
+ ),
227
+ gr.Audio(label="Audio with Custom Voice"),
228
+ ],
229
+ # title="🥳💬💕 - TalktoAI,随时随地,谈天说地!",
230
+ description="🤖 - 让有人文关怀的AI造福每一个人!AI向善,文明璀璨!TalktoAI - Enable the future!",
231
+ article = "Powered by [Alpaca-LoRA](https://github.com/tloen/alpaca-lora). Credit: tloen[https://github.com/tloen].",
232
+ )
233
+
234
+ demo = gr.TabbedInterface([c1, c2], ["wav/mp3上传", "麦克风上传"], title = '🥳💬💕 - TalktoAI,随时随地,谈天说地!')
235
+ demo.queue(concurrency_count=1)
236
+ demo.launch(show_error = True)
237
+
238
 
239
  # Old testing code follows.
240