Huyen2310 commited on
Commit
7bde1c4
1 Parent(s): 09cff40

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +624 -0
app.py ADDED
@@ -0,0 +1,624 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from scipy.io.wavfile import write
3
+ import librosa
4
+ import os
5
+
6
+ examples = []
7
+ folder_path = "./Data Record"
8
+ for file_name in os.listdir(folder_path):
9
+ if file_name.endswith(".txt"):
10
+ file_path = os.path.join(folder_path, file_name)
11
+ with open(file_path, "r", encoding="utf-8") as f:
12
+ content = f.read()
13
+ examples.append([file_name.split(".")[0], content])
14
+
15
+ examples1 = examples[0:400]
16
+ examples2 = examples[400:800]
17
+ examples3 = examples[800:1200]
18
+ examples4 = examples[1200:1600]
19
+ examples5 = examples[1600:2000]
20
+ examples6 = examples[2000:2400]
21
+ examples7 = examples[2400:2800]
22
+ examples8 = examples[2800:3200]
23
+ examples9 = examples[3200:3600]
24
+ examples10 = examples[3600:4000]
25
+ examples11 = examples[4000:4400]
26
+ examples12 = examples[4400:4800]
27
+ examples13 = examples[4800:5200]
28
+ examples14 = examples[5200:5600]
29
+ examples15 = examples[5600:6000]
30
+ examples16 = examples[6000:6400]
31
+ examples17 = examples[6400:6800]
32
+ examples18 = examples[6800:7200]
33
+ examples19 = examples[7200:7600]
34
+ examples20 = examples[7600:8000]
35
+ examples21 = examples[8000:8400]
36
+ examples22 = examples[8400:8800]
37
+ examples23 = examples[8800:9200]
38
+ examples24 = examples[9200:9600]
39
+ examples25 = examples[9600:10000]
40
+ examples26 = examples[10000:10400]
41
+ examples27 = examples[10400:10800]
42
+ examples28 = examples[10800:11200]
43
+ examples29 = examples[11200:11600]
44
+ examples30 = examples[11600:12000]
45
+ examples31 = examples[12000:12400]
46
+ examples32 = examples[12400:12800]
47
+ examples33 = examples[12800:13200]
48
+ examples34 = examples[13200:13600]
49
+ examples35 = examples[13600:14000]
50
+
51
+ folder_name = "Data"
52
+ path = folder_name
53
+ if not os.path.exists(path):
54
+ os.makedirs(path)
55
+
56
+
57
+ def speak1(text1, text2, path):
58
+ warn_output = ""
59
+ if (path is not None):
60
+ warn_output = (
61
+ "WARNING: You've uploaded an audio file and used the microphone. "
62
+ "The recorded file from the microphone will be used and the uploaded audio will be discarded.\n"
63
+ )
64
+
65
+ elif (path is None):
66
+ return "ERROR: You have to either use the microphone or upload an audio file"
67
+
68
+ X_new, sr_new = librosa.load(path)
69
+ folder_name = "./Data1/"
70
+ dst = folder_name + text1 + ".wav"
71
+ write(dst, sr_new, X_new)
72
+
73
+ return "Done"
74
+
75
+ def speak2(text1, text2, path):
76
+ warn_output = ""
77
+ if (path is not None):
78
+ warn_output = (
79
+ "WARNING: You've uploaded an audio file and used the microphone. "
80
+ "The recorded file from the microphone will be used and the uploaded audio will be discarded.\n"
81
+ )
82
+
83
+ elif (path is None):
84
+ return "ERROR: You have to either use the microphone or upload an audio file"
85
+
86
+ X_new, sr_new = librosa.load(path)
87
+ folder_name = "./Data2/"
88
+ dst = folder_name + text1 + ".wav"
89
+ write(dst, sr_new, X_new)
90
+
91
+ return "Done"
92
+
93
+ def speak3(text1, text2, path):
94
+ warn_output = ""
95
+ if (path is not None):
96
+ warn_output = (
97
+ "WARNING: You've uploaded an audio file and used the microphone. "
98
+ "The recorded file from the microphone will be used and the uploaded audio will be discarded.\n"
99
+ )
100
+
101
+ elif (path is None):
102
+ return "ERROR: You have to either use the microphone or upload an audio file"
103
+
104
+ X_new, sr_new = librosa.load(path)
105
+ folder_name = "./Data3/"
106
+ dst = folder_name + text1 + ".wav"
107
+ write(dst, sr_new, X_new)
108
+
109
+ return "Done"
110
+
111
+ def speak4(text1, text2, path):
112
+ warn_output = ""
113
+ if (path is not None):
114
+ warn_output = (
115
+ "WARNING: You've uploaded an audio file and used the microphone. "
116
+ "The recorded file from the microphone will be used and the uploaded audio will be discarded.\n"
117
+ )
118
+
119
+ elif (path is None):
120
+ return "ERROR: You have to either use the microphone or upload an audio file"
121
+
122
+ X_new, sr_new = librosa.load(path)
123
+ folder_name = "./Data/"
124
+ dst = folder_name + text1 + ".wav"
125
+ write(dst, sr_new, X_new)
126
+
127
+ return "Done"
128
+
129
+ def speak(text1, text2, path):
130
+ warn_output = ""
131
+ if (path is not None):
132
+ warn_output = (
133
+ "WARNING: You've uploaded an audio file and used the microphone. "
134
+ "The recorded file from the microphone will be used and the uploaded audio will be discarded.\n"
135
+ )
136
+
137
+ elif (path is None):
138
+ return "ERROR: You have to either use the microphone or upload an audio file"
139
+
140
+ X_new, sr_new = librosa.load(path)
141
+ folder_name = "./Data/"
142
+ dst = folder_name + text1 + ".wav"
143
+ write(dst, sr_new, X_new)
144
+
145
+ return "Done"
146
+
147
+ def speak(text1, text2, path):
148
+ warn_output = ""
149
+ if (path is not None):
150
+ warn_output = (
151
+ "WARNING: You've uploaded an audio file and used the microphone. "
152
+ "The recorded file from the microphone will be used and the uploaded audio will be discarded.\n"
153
+ )
154
+
155
+ elif (path is None):
156
+ return "ERROR: You have to either use the microphone or upload an audio file"
157
+
158
+ X_new, sr_new = librosa.load(path)
159
+ folder_name = "./Data/"
160
+ dst = folder_name + text1 + ".wav"
161
+ write(dst, sr_new, X_new)
162
+
163
+ return "Done"
164
+
165
+ def speak(text1, text2, path):
166
+ warn_output = ""
167
+ if (path is not None):
168
+ warn_output = (
169
+ "WARNING: You've uploaded an audio file and used the microphone. "
170
+ "The recorded file from the microphone will be used and the uploaded audio will be discarded.\n"
171
+ )
172
+
173
+ elif (path is None):
174
+ return "ERROR: You have to either use the microphone or upload an audio file"
175
+
176
+ X_new, sr_new = librosa.load(path)
177
+ folder_name = "./Data/"
178
+ dst = folder_name + text1 + ".wav"
179
+ write(dst, sr_new, X_new)
180
+
181
+ return "Done"
182
+
183
+ def speak(text1, text2, path):
184
+ warn_output = ""
185
+ if (path is not None):
186
+ warn_output = (
187
+ "WARNING: You've uploaded an audio file and used the microphone. "
188
+ "The recorded file from the microphone will be used and the uploaded audio will be discarded.\n"
189
+ )
190
+
191
+ elif (path is None):
192
+ return "ERROR: You have to either use the microphone or upload an audio file"
193
+
194
+ X_new, sr_new = librosa.load(path)
195
+ folder_name = "./Data/"
196
+ dst = folder_name + text1 + ".wav"
197
+ write(dst, sr_new, X_new)
198
+
199
+ return "Done"
200
+
201
+
202
+ title = "Data"
203
+
204
+ p1 = gr.Interface(
205
+ fn=speak,
206
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
207
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
208
+ outputs="text",
209
+ title=title,
210
+ examples=examples1,
211
+ theme="default",
212
+ allow_screenshot=False,
213
+ allow_flagging="never",
214
+ )
215
+
216
+ p2 = gr.Interface(
217
+ fn=speak,
218
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
219
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
220
+ outputs="text",
221
+ title=title,
222
+ examples=examples2,
223
+ theme="default",
224
+ allow_screenshot=False,
225
+ allow_flagging="never",
226
+ )
227
+
228
+ p3 = gr.Interface(
229
+ fn=speak,
230
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
231
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
232
+ outputs="text",
233
+ title=title,
234
+ examples=examples3,
235
+ theme="default",
236
+ allow_screenshot=False,
237
+ allow_flagging="never",
238
+ )
239
+
240
+ p4 = gr.Interface(
241
+ fn=speak,
242
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
243
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
244
+ outputs="text",
245
+ title=title,
246
+ examples=examples4,
247
+ theme="default",
248
+ allow_screenshot=False,
249
+ allow_flagging="never",
250
+ )
251
+
252
+ p5 = gr.Interface(
253
+ fn=speak,
254
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
255
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
256
+ outputs="text",
257
+ title=title,
258
+ examples=examples5,
259
+ theme="default",
260
+ allow_screenshot=False,
261
+ allow_flagging="never",
262
+ )
263
+
264
+ p6 = gr.Interface(
265
+ fn=speak,
266
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
267
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
268
+ outputs="text",
269
+ title=title,
270
+ examples=examples6,
271
+ theme="default",
272
+ allow_screenshot=False,
273
+ allow_flagging="never",
274
+ )
275
+
276
+ p7 = gr.Interface(
277
+ fn=speak,
278
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
279
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
280
+ outputs="text",
281
+ title=title,
282
+ examples=examples7,
283
+ theme="default",
284
+ allow_screenshot=False,
285
+ allow_flagging="never",
286
+ )
287
+
288
+ p8 = gr.Interface(
289
+ fn=speak,
290
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
291
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
292
+ outputs="text",
293
+ title=title,
294
+ examples=examples8,
295
+ theme="default",
296
+ allow_screenshot=False,
297
+ allow_flagging="never",
298
+ )
299
+
300
+ p9 = gr.Interface(
301
+ fn=speak,
302
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
303
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
304
+ outputs="text",
305
+ title=title,
306
+ examples=examples9,
307
+ theme="default",
308
+ allow_screenshot=False,
309
+ allow_flagging="never",
310
+ )
311
+
312
+ p10 = gr.Interface(
313
+ fn=speak,
314
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
315
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
316
+ outputs="text",
317
+ title=title,
318
+ examples=examples10,
319
+ theme="default",
320
+ allow_screenshot=False,
321
+ allow_flagging="never",
322
+ )
323
+
324
+ p11 = gr.Interface(
325
+ fn=speak,
326
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
327
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
328
+ outputs="text",
329
+ title=title,
330
+ examples=examples11,
331
+ theme="default",
332
+ allow_screenshot=False,
333
+ allow_flagging="never",
334
+ )
335
+
336
+ p12 = gr.Interface(
337
+ fn=speak,
338
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
339
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
340
+ outputs="text",
341
+ title=title,
342
+ examples=examples12,
343
+ theme="default",
344
+ allow_screenshot=False,
345
+ allow_flagging="never",
346
+ )
347
+
348
+ p13 = gr.Interface(
349
+ fn=speak,
350
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
351
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
352
+ outputs="text",
353
+ title=title,
354
+ examples=examples13,
355
+ theme="default",
356
+ allow_screenshot=False,
357
+ allow_flagging="never",
358
+ )
359
+
360
+ p14 = gr.Interface(
361
+ fn=speak,
362
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
363
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
364
+ outputs="text",
365
+ title=title,
366
+ examples=examples14,
367
+ theme="default",
368
+ allow_screenshot=False,
369
+ allow_flagging="never",
370
+ )
371
+
372
+ p15 = gr.Interface(
373
+ fn=speak,
374
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
375
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
376
+ outputs="text",
377
+ title=title,
378
+ examples=examples15,
379
+ theme="default",
380
+ allow_screenshot=False,
381
+ allow_flagging="never",
382
+ )
383
+
384
+ p16 = gr.Interface(
385
+ fn=speak,
386
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
387
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
388
+ outputs="text",
389
+ title=title,
390
+ examples=examples16,
391
+ theme="default",
392
+ allow_screenshot=False,
393
+ allow_flagging="never",
394
+ )
395
+
396
+ p17 = gr.Interface(
397
+ fn=speak,
398
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
399
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
400
+ outputs="text",
401
+ title=title,
402
+ examples=examples17,
403
+ theme="default",
404
+ allow_screenshot=False,
405
+ allow_flagging="never",
406
+ )
407
+
408
+ p18 = gr.Interface(
409
+ fn=speak,
410
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
411
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
412
+ outputs="text",
413
+ title=title,
414
+ examples=examples18,
415
+ theme="default",
416
+ allow_screenshot=False,
417
+ allow_flagging="never",
418
+ )
419
+
420
+ p19 = gr.Interface(
421
+ fn=speak,
422
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
423
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
424
+ outputs="text",
425
+ title=title,
426
+ examples=examples19,
427
+ theme="default",
428
+ allow_screenshot=False,
429
+ allow_flagging="never",
430
+ )
431
+
432
+ p20 = gr.Interface(
433
+ fn=speak,
434
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
435
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
436
+ outputs="text",
437
+ title=title,
438
+ examples=examples20,
439
+ theme="default",
440
+ allow_screenshot=False,
441
+ allow_flagging="never",
442
+ )
443
+ p21 = gr.Interface(
444
+ fn=speak,
445
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
446
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
447
+ outputs="text",
448
+ title=title,
449
+ examples=examples21,
450
+ theme="default",
451
+ allow_screenshot=False,
452
+ allow_flagging="never",
453
+ )
454
+ p22 = gr.Interface(
455
+ fn=speak,
456
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
457
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
458
+ outputs="text",
459
+ title=title,
460
+ examples=examples22,
461
+ theme="default",
462
+ allow_screenshot=False,
463
+ allow_flagging="never",
464
+ )
465
+ p23 = gr.Interface(
466
+ fn=speak,
467
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
468
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
469
+ outputs="text",
470
+ title=title,
471
+ examples=examples23,
472
+ theme="default",
473
+ allow_screenshot=False,
474
+ allow_flagging="never",
475
+ )
476
+ p24 = gr.Interface(
477
+ fn=speak,
478
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
479
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
480
+ outputs="text",
481
+ title=title,
482
+ examples=examples24,
483
+ theme="default",
484
+ allow_screenshot=False,
485
+ allow_flagging="never",
486
+ )
487
+ p25 = gr.Interface(
488
+ fn=speak,
489
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
490
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
491
+ outputs="text",
492
+ title=title,
493
+ examples=examples25,
494
+ theme="default",
495
+ allow_screenshot=False,
496
+ allow_flagging="never",
497
+ )
498
+ p26 = gr.Interface(
499
+ fn=speak,
500
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
501
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
502
+ outputs="text",
503
+ title=title,
504
+ examples=examples26,
505
+ theme="default",
506
+ allow_screenshot=False,
507
+ allow_flagging="never",
508
+ )
509
+ p27 = gr.Interface(
510
+ fn=speak,
511
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
512
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
513
+ outputs="text",
514
+ title=title,
515
+ examples=examples27,
516
+ theme="default",
517
+ allow_screenshot=False,
518
+ allow_flagging="never",
519
+ )
520
+ p28 = gr.Interface(
521
+ fn=speak,
522
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
523
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
524
+ outputs="text",
525
+ title=title,
526
+ examples=examples28,
527
+ theme="default",
528
+ allow_screenshot=False,
529
+ allow_flagging="never",
530
+ )
531
+ p29 = gr.Interface(
532
+ fn=speak,
533
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
534
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
535
+ outputs="text",
536
+ title=title,
537
+ examples=examples29,
538
+ theme="default",
539
+ allow_screenshot=False,
540
+ allow_flagging="never",
541
+ )
542
+ p30 = gr.Interface(
543
+ fn=speak,
544
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
545
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
546
+ outputs="text",
547
+ title=title,
548
+ examples=examples30,
549
+ theme="default",
550
+ allow_screenshot=False,
551
+ allow_flagging="never",
552
+ )
553
+ p31 = gr.Interface(
554
+ fn=speak,
555
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
556
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
557
+ outputs="text",
558
+ title=title,
559
+ examples=examples31,
560
+ theme="default",
561
+ allow_screenshot=False,
562
+ allow_flagging="never",
563
+ )
564
+ p32 = gr.Interface(
565
+ fn=speak,
566
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
567
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
568
+ outputs="text",
569
+ title=title,
570
+ examples=examples32,
571
+ theme="default",
572
+ allow_screenshot=False,
573
+ allow_flagging="never",
574
+ )
575
+
576
+ p33 = gr.Interface(
577
+ fn=speak,
578
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
579
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
580
+ outputs="text",
581
+ title=title,
582
+ examples=examples33,
583
+ theme="default",
584
+ allow_screenshot=False,
585
+ allow_flagging="never",
586
+ )
587
+ p34 = gr.Interface(
588
+ fn=speak,
589
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
590
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
591
+ outputs="text",
592
+ title=title,
593
+ examples=examples34,
594
+ theme="default",
595
+ allow_screenshot=False,
596
+ allow_flagging="never",
597
+ )
598
+ p35 = gr.Interface(
599
+ fn=speak,
600
+ inputs=[gr.inputs.Textbox(label="Number 1"), gr.inputs.Textbox(label="Number 2"),
601
+ gr.inputs.Audio(source="microphone", type="filepath", optional=True)],
602
+ outputs="text",
603
+ title=title,
604
+ examples=examples35,
605
+ theme="default",
606
+ allow_screenshot=False,
607
+ allow_flagging="never",
608
+ )
609
+
610
+ demo = gr.Blocks()
611
+
612
+ with demo:
613
+ gr.TabbedInterface([p1, p2, p3, p4, p5, p6, p7,
614
+ p8, p9, p10, p11, p12, p13, p14,
615
+ p15, p16, p17, p18, p19, p20, p21,
616
+ p22, p23, p24, p25, p26, p27, p28,
617
+ p29, p30, p31, p32, p33, p34, p35],
618
+ ["Data 1", "Data 2", "Data 3", "Data 4", "Data 5", "Data 6", "Data 7",
619
+ "Data 8", "Data 9", "Data 10", "Data 11", "Data 12", "Data 13", "Data 14",
620
+ "Data 15", "Data 16", "Data 17", "Data 18", "Data 19", "Data 20", "Data 21",
621
+ "Data 22", "Data 23", "Data 24", "Data 25", "Data 26", "Data 27", "Data 28",
622
+ "Data 29", "Data 30", "Data 31", "Data 32", "Data 33", "Data 34", "Data 35"])
623
+
624
+ demo.launch(share=True)