matdmiller commited on
Commit
7c74b13
·
1 Parent(s): aec21f8
Files changed (2) hide show
  1. app.ipynb +29 -188
  2. app.py +4 -4
app.ipynb CHANGED
@@ -2,7 +2,7 @@
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
- "execution_count": 1,
6
  "id": "3bedf0dc-8d8e-4ede-a9e6-b8f35136aa00",
7
  "metadata": {},
8
  "outputs": [],
@@ -12,20 +12,10 @@
12
  },
13
  {
14
  "cell_type": "code",
15
- "execution_count": 1,
16
  "id": "667802a7-0f36-4136-a381-e66210b20462",
17
  "metadata": {},
18
- "outputs": [
19
- {
20
- "name": "stdout",
21
- "output_type": "stream",
22
- "text": [
23
- "OPENAI_API_KEY environment variable was not found.\n",
24
- "GRADIO_PASSWORD environment variable was not found.\n",
25
- "import tts_openai_secrets succeeded\n"
26
- ]
27
- }
28
- ],
29
  "source": [
30
  "#| export\n",
31
  "#tts_openai_secrets.py content:\n",
@@ -54,7 +44,7 @@
54
  },
55
  {
56
  "cell_type": "code",
57
- "execution_count": 2,
58
  "id": "4d9863fc-969e-409b-8e20-b9c3cd2cc3e7",
59
  "metadata": {},
60
  "outputs": [],
@@ -68,7 +58,7 @@
68
  },
69
  {
70
  "cell_type": "code",
71
- "execution_count": 3,
72
  "id": "4f486d3a",
73
  "metadata": {},
74
  "outputs": [],
@@ -91,18 +81,10 @@
91
  },
92
  {
93
  "cell_type": "code",
94
- "execution_count": 4,
95
  "id": "0ffd33b4-cb9b-4c01-bff6-4c3102854ab6",
96
  "metadata": {},
97
- "outputs": [
98
- {
99
- "name": "stdout",
100
- "output_type": "stream",
101
- "text": [
102
- "successfully got tts model list: ['tts-1-hd-1106', 'tts-1-hd', 'tts-1', 'tts-1-1106']\n"
103
- ]
104
- }
105
- ],
106
  "source": [
107
  "#| export\n",
108
  "try:\n",
@@ -114,7 +96,7 @@
114
  },
115
  {
116
  "cell_type": "code",
117
- "execution_count": 5,
118
  "id": "2ddbca5d-4b04-43ab-afaf-430802980e78",
119
  "metadata": {},
120
  "outputs": [],
@@ -125,7 +107,7 @@
125
  },
126
  {
127
  "cell_type": "code",
128
- "execution_count": 6,
129
  "id": "8eb7e7d5-7121-4762-b8d1-e5a9539e2b36",
130
  "metadata": {},
131
  "outputs": [],
@@ -136,7 +118,7 @@
136
  },
137
  {
138
  "cell_type": "code",
139
- "execution_count": 7,
140
  "id": "52d373be-3a79-412e-8ca2-92bb443fa52d",
141
  "metadata": {},
142
  "outputs": [],
@@ -148,7 +130,7 @@
148
  },
149
  {
150
  "cell_type": "code",
151
- "execution_count": 8,
152
  "id": "24674094-4d47-4e48-b591-55faabcff8df",
153
  "metadata": {},
154
  "outputs": [],
@@ -189,7 +171,7 @@
189
  },
190
  {
191
  "cell_type": "code",
192
- "execution_count": 9,
193
  "id": "e6224ae5-3792-42b2-8392-3abd42998a50",
194
  "metadata": {},
195
  "outputs": [],
@@ -227,7 +209,7 @@
227
  },
228
  {
229
  "cell_type": "code",
230
- "execution_count": 12,
231
  "id": "4691703d-ed0f-4481-8006-b2906289b780",
232
  "metadata": {},
233
  "outputs": [],
@@ -247,14 +229,14 @@
247
  },
248
  {
249
  "cell_type": "code",
250
- "execution_count": 10,
251
  "id": "e34bb4aa-698c-4452-8cda-bd02b38f7122",
252
  "metadata": {},
253
  "outputs": [],
254
  "source": [
255
  "#| export\n",
256
- "def create_speech2(input_text, model='tts-1', voice='alloy', progress=gr.Progress(), **kwargs):\n",
257
- " assert authorized(None) is not None,'Unauthorized M'\n",
258
  " start = datetime.now()\n",
259
  " # Split the input text into chunks\n",
260
  " chunks = split_text(input_text)\n",
@@ -289,14 +271,14 @@
289
  },
290
  {
291
  "cell_type": "code",
292
- "execution_count": 14,
293
  "id": "5388e860",
294
  "metadata": {},
295
  "outputs": [],
296
  "source": [
297
  "#| export\n",
298
- "def create_speech(input_text, model='tts-1', voice='alloy', progress=gr.Progress()):\n",
299
- " assert authorized(None) is not None,'Unauthorized M'\n",
300
  " # Split the input text into chunks\n",
301
  " chunks = split_text(input_text)\n",
302
  "\n",
@@ -340,7 +322,7 @@
340
  },
341
  {
342
  "cell_type": "code",
343
- "execution_count": 15,
344
  "id": "236dd8d3-4364-4731-af93-7dcdec6f18a1",
345
  "metadata": {},
346
  "outputs": [],
@@ -352,7 +334,7 @@
352
  },
353
  {
354
  "cell_type": "code",
355
- "execution_count": 16,
356
  "id": "0523a158-ee07-48b3-9350-ee39d4deee7f",
357
  "metadata": {},
358
  "outputs": [],
@@ -369,7 +351,7 @@
369
  },
370
  {
371
  "cell_type": "code",
372
- "execution_count": 17,
373
  "id": "b5b29507-92bc-453d-bcc5-6402c17e9a0d",
374
  "metadata": {},
375
  "outputs": [],
@@ -384,19 +366,10 @@
384
  },
385
  {
386
  "cell_type": "code",
387
- "execution_count": 18,
388
  "id": "e4fb3159-579b-4271-bc96-4cd1e2816eca",
389
  "metadata": {},
390
- "outputs": [
391
- {
392
- "name": "stderr",
393
- "output_type": "stream",
394
- "text": [
395
- "/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/oauth.py:138: UserWarning: Gradio does not support OAuth features outside of a Space environment. To help you debug your app locally, the login and logout buttons are mocked with your profile. To make it work, your machine must be logged in to Huggingface.\n",
396
- " warnings.warn(\n"
397
- ]
398
- }
399
- ],
400
  "source": [
401
  "#| export\n",
402
  "with gr.Blocks(title='OpenAI TTS', head='OpenAI TTS') as app:\n",
@@ -427,7 +400,7 @@
427
  },
428
  {
429
  "cell_type": "code",
430
- "execution_count": 20,
431
  "id": "a00648a1-891b-470b-9959-f5d502055713",
432
  "metadata": {},
433
  "outputs": [],
@@ -441,142 +414,10 @@
441
  },
442
  {
443
  "cell_type": "code",
444
- "execution_count": 21,
445
  "id": "4b534fe7-4337-423e-846a-1bdb7cccc4ea",
446
  "metadata": {},
447
- "outputs": [
448
- {
449
- "name": "stdout",
450
- "output_type": "stream",
451
- "text": [
452
- "Running on local URL: http://127.0.0.1:7860\n",
453
- "\n",
454
- "To create a public link, set `share=True` in `launch()`.\n"
455
- ]
456
- },
457
- {
458
- "data": {
459
- "text/html": [
460
- "<div><iframe src=\"http://127.0.0.1:7860/\" width=\"100%\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"
461
- ],
462
- "text/plain": [
463
- "<IPython.core.display.HTML object>"
464
- ]
465
- },
466
- "metadata": {},
467
- "output_type": "display_data"
468
- },
469
- {
470
- "data": {
471
- "text/plain": []
472
- },
473
- "execution_count": 21,
474
- "metadata": {},
475
- "output_type": "execute_result"
476
- },
477
- {
478
- "name": "stderr",
479
- "output_type": "stream",
480
- "text": [
481
- "/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/components/login_button.py:74: UserWarning: LoginButton created outside of a Blocks context. May not work unless you call its `activate()` method manually.\n",
482
- " warnings.warn(\n",
483
- "Traceback (most recent call last):\n",
484
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/queueing.py\", line 532, in process_events\n",
485
- " response = await route_utils.call_process_api(\n",
486
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
487
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/route_utils.py\", line 276, in call_process_api\n",
488
- " output = await app.get_blocks().process_api(\n",
489
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
490
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/blocks.py\", line 1928, in process_api\n",
491
- " result = await self.call_function(\n",
492
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n",
493
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/blocks.py\", line 1500, in call_function\n",
494
- " processed_input, progress_index, _ = special_args(\n",
495
- " ^^^^^^^^^^^^^\n",
496
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/helpers.py\", line 907, in special_args\n",
497
- " raise Error(\n",
498
- "gradio.exceptions.Error: 'This action requires a logged in user. Please sign in and retry.'\n",
499
- "Traceback (most recent call last):\n",
500
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/queueing.py\", line 532, in process_events\n",
501
- " response = await route_utils.call_process_api(\n",
502
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
503
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/route_utils.py\", line 276, in call_process_api\n",
504
- " output = await app.get_blocks().process_api(\n",
505
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
506
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/blocks.py\", line 1928, in process_api\n",
507
- " result = await self.call_function(\n",
508
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n",
509
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/blocks.py\", line 1500, in call_function\n",
510
- " processed_input, progress_index, _ = special_args(\n",
511
- " ^^^^^^^^^^^^^\n",
512
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/helpers.py\", line 907, in special_args\n",
513
- " raise Error(\n",
514
- "gradio.exceptions.Error: 'This action requires a logged in user. Please sign in and retry.'\n",
515
- "Traceback (most recent call last):\n",
516
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/queueing.py\", line 532, in process_events\n",
517
- " response = await route_utils.call_process_api(\n",
518
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
519
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/route_utils.py\", line 276, in call_process_api\n",
520
- " output = await app.get_blocks().process_api(\n",
521
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
522
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/blocks.py\", line 1928, in process_api\n",
523
- " result = await self.call_function(\n",
524
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n",
525
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/blocks.py\", line 1500, in call_function\n",
526
- " processed_input, progress_index, _ = special_args(\n",
527
- " ^^^^^^^^^^^^^\n",
528
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/helpers.py\", line 907, in special_args\n",
529
- " raise Error(\n",
530
- "gradio.exceptions.Error: 'This action requires a logged in user. Please sign in and retry.'\n"
531
- ]
532
- },
533
- {
534
- "name": "stdout",
535
- "output_type": "stream",
536
- "text": [
537
- "Processing time: 0 seconds.\n",
538
- "Processing time: 0 seconds.\n"
539
- ]
540
- },
541
- {
542
- "name": "stderr",
543
- "output_type": "stream",
544
- "text": [
545
- "Traceback (most recent call last):\n",
546
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/queueing.py\", line 532, in process_events\n",
547
- " response = await route_utils.call_process_api(\n",
548
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
549
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/route_utils.py\", line 276, in call_process_api\n",
550
- " output = await app.get_blocks().process_api(\n",
551
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
552
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/blocks.py\", line 1928, in process_api\n",
553
- " result = await self.call_function(\n",
554
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n",
555
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/blocks.py\", line 1500, in call_function\n",
556
- " processed_input, progress_index, _ = special_args(\n",
557
- " ^^^^^^^^^^^^^\n",
558
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/helpers.py\", line 907, in special_args\n",
559
- " raise Error(\n",
560
- "gradio.exceptions.Error: 'This action requires a logged in user. Please sign in and retry.'\n",
561
- "Traceback (most recent call last):\n",
562
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/queueing.py\", line 532, in process_events\n",
563
- " response = await route_utils.call_process_api(\n",
564
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
565
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/route_utils.py\", line 276, in call_process_api\n",
566
- " output = await app.get_blocks().process_api(\n",
567
- " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
568
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/blocks.py\", line 1928, in process_api\n",
569
- " result = await self.call_function(\n",
570
- " ^^^^^^^^^^^^^^^^^^^^^^^^^\n",
571
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/blocks.py\", line 1500, in call_function\n",
572
- " processed_input, progress_index, _ = special_args(\n",
573
- " ^^^^^^^^^^^^^\n",
574
- " File \"/Users/mathewmiller/anaconda3/envs/gradio1/lib/python3.11/site-packages/gradio/helpers.py\", line 907, in special_args\n",
575
- " raise Error(\n",
576
- "gradio.exceptions.Error: 'This action requires a logged in user. Please sign in and retry.'\n"
577
- ]
578
- }
579
- ],
580
  "source": [
581
  "#| hide\n",
582
  "#Notebook launch\n",
@@ -611,7 +452,7 @@
611
  },
612
  {
613
  "cell_type": "code",
614
- "execution_count": 22,
615
  "id": "afbc9699-4d16-4060-88f4-cd1251754cbd",
616
  "metadata": {},
617
  "outputs": [],
@@ -622,7 +463,7 @@
622
  },
623
  {
624
  "cell_type": "code",
625
- "execution_count": 23,
626
  "id": "0420310d-930b-4904-8bd4-3458ad8bdbd3",
627
  "metadata": {},
628
  "outputs": [],
 
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
+ "execution_count": null,
6
  "id": "3bedf0dc-8d8e-4ede-a9e6-b8f35136aa00",
7
  "metadata": {},
8
  "outputs": [],
 
12
  },
13
  {
14
  "cell_type": "code",
15
+ "execution_count": null,
16
  "id": "667802a7-0f36-4136-a381-e66210b20462",
17
  "metadata": {},
18
+ "outputs": [],
 
 
 
 
 
 
 
 
 
 
19
  "source": [
20
  "#| export\n",
21
  "#tts_openai_secrets.py content:\n",
 
44
  },
45
  {
46
  "cell_type": "code",
47
+ "execution_count": null,
48
  "id": "4d9863fc-969e-409b-8e20-b9c3cd2cc3e7",
49
  "metadata": {},
50
  "outputs": [],
 
58
  },
59
  {
60
  "cell_type": "code",
61
+ "execution_count": null,
62
  "id": "4f486d3a",
63
  "metadata": {},
64
  "outputs": [],
 
81
  },
82
  {
83
  "cell_type": "code",
84
+ "execution_count": null,
85
  "id": "0ffd33b4-cb9b-4c01-bff6-4c3102854ab6",
86
  "metadata": {},
87
+ "outputs": [],
 
 
 
 
 
 
 
 
88
  "source": [
89
  "#| export\n",
90
  "try:\n",
 
96
  },
97
  {
98
  "cell_type": "code",
99
+ "execution_count": null,
100
  "id": "2ddbca5d-4b04-43ab-afaf-430802980e78",
101
  "metadata": {},
102
  "outputs": [],
 
107
  },
108
  {
109
  "cell_type": "code",
110
+ "execution_count": null,
111
  "id": "8eb7e7d5-7121-4762-b8d1-e5a9539e2b36",
112
  "metadata": {},
113
  "outputs": [],
 
118
  },
119
  {
120
  "cell_type": "code",
121
+ "execution_count": null,
122
  "id": "52d373be-3a79-412e-8ca2-92bb443fa52d",
123
  "metadata": {},
124
  "outputs": [],
 
130
  },
131
  {
132
  "cell_type": "code",
133
+ "execution_count": null,
134
  "id": "24674094-4d47-4e48-b591-55faabcff8df",
135
  "metadata": {},
136
  "outputs": [],
 
171
  },
172
  {
173
  "cell_type": "code",
174
+ "execution_count": null,
175
  "id": "e6224ae5-3792-42b2-8392-3abd42998a50",
176
  "metadata": {},
177
  "outputs": [],
 
209
  },
210
  {
211
  "cell_type": "code",
212
+ "execution_count": null,
213
  "id": "4691703d-ed0f-4481-8006-b2906289b780",
214
  "metadata": {},
215
  "outputs": [],
 
229
  },
230
  {
231
  "cell_type": "code",
232
+ "execution_count": null,
233
  "id": "e34bb4aa-698c-4452-8cda-bd02b38f7122",
234
  "metadata": {},
235
  "outputs": [],
236
  "source": [
237
  "#| export\n",
238
+ "def create_speech2(input_text, model='tts-1', voice='alloy', progress=gr.Progress(),profile: gr.OAuthProfile=None, **kwargs):\n",
239
+ " assert authorized(profile) is not None,'Unauthorized M'\n",
240
  " start = datetime.now()\n",
241
  " # Split the input text into chunks\n",
242
  " chunks = split_text(input_text)\n",
 
271
  },
272
  {
273
  "cell_type": "code",
274
+ "execution_count": null,
275
  "id": "5388e860",
276
  "metadata": {},
277
  "outputs": [],
278
  "source": [
279
  "#| export\n",
280
+ "def create_speech(input_text, model='tts-1', voice='alloy', progress=gr.Progress(), profile: gr.OAuthProfile=None):\n",
281
+ " assert authorized(profile) is not None,'Unauthorized M'\n",
282
  " # Split the input text into chunks\n",
283
  " chunks = split_text(input_text)\n",
284
  "\n",
 
322
  },
323
  {
324
  "cell_type": "code",
325
+ "execution_count": null,
326
  "id": "236dd8d3-4364-4731-af93-7dcdec6f18a1",
327
  "metadata": {},
328
  "outputs": [],
 
334
  },
335
  {
336
  "cell_type": "code",
337
+ "execution_count": null,
338
  "id": "0523a158-ee07-48b3-9350-ee39d4deee7f",
339
  "metadata": {},
340
  "outputs": [],
 
351
  },
352
  {
353
  "cell_type": "code",
354
+ "execution_count": null,
355
  "id": "b5b29507-92bc-453d-bcc5-6402c17e9a0d",
356
  "metadata": {},
357
  "outputs": [],
 
366
  },
367
  {
368
  "cell_type": "code",
369
+ "execution_count": null,
370
  "id": "e4fb3159-579b-4271-bc96-4cd1e2816eca",
371
  "metadata": {},
372
+ "outputs": [],
 
 
 
 
 
 
 
 
 
373
  "source": [
374
  "#| export\n",
375
  "with gr.Blocks(title='OpenAI TTS', head='OpenAI TTS') as app:\n",
 
400
  },
401
  {
402
  "cell_type": "code",
403
+ "execution_count": null,
404
  "id": "a00648a1-891b-470b-9959-f5d502055713",
405
  "metadata": {},
406
  "outputs": [],
 
414
  },
415
  {
416
  "cell_type": "code",
417
+ "execution_count": null,
418
  "id": "4b534fe7-4337-423e-846a-1bdb7cccc4ea",
419
  "metadata": {},
420
+ "outputs": [],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
421
  "source": [
422
  "#| hide\n",
423
  "#Notebook launch\n",
 
452
  },
453
  {
454
  "cell_type": "code",
455
+ "execution_count": null,
456
  "id": "afbc9699-4d16-4060-88f4-cd1251754cbd",
457
  "metadata": {},
458
  "outputs": [],
 
463
  },
464
  {
465
  "cell_type": "code",
466
+ "execution_count": null,
467
  "id": "0420310d-930b-4904-8bd4-3458ad8bdbd3",
468
  "metadata": {},
469
  "outputs": [],
app.py CHANGED
@@ -138,8 +138,8 @@ def create_speech_openai(chunk_idx, input, model='tts-1', voice='alloy', speed=1
138
  return chunk_idx, response.content
139
 
140
  # %% app.ipynb 11
141
- def create_speech2(input_text, model='tts-1', voice='alloy', progress=gr.Progress(), **kwargs):
142
- assert authorized(None) is not None,'Unauthorized M'
143
  start = datetime.now()
144
  # Split the input text into chunks
145
  chunks = split_text(input_text)
@@ -173,8 +173,8 @@ def create_speech2(input_text, model='tts-1', voice='alloy', progress=gr.Progres
173
 
174
 
175
  # %% app.ipynb 12
176
- def create_speech(input_text, model='tts-1', voice='alloy', progress=gr.Progress()):
177
- assert authorized(None) is not None,'Unauthorized M'
178
  # Split the input text into chunks
179
  chunks = split_text(input_text)
180
 
 
138
  return chunk_idx, response.content
139
 
140
  # %% app.ipynb 11
141
+ def create_speech2(input_text, model='tts-1', voice='alloy', progress=gr.Progress(),profile: gr.OAuthProfile=None, **kwargs):
142
+ assert authorized(profile) is not None,'Unauthorized M'
143
  start = datetime.now()
144
  # Split the input text into chunks
145
  chunks = split_text(input_text)
 
173
 
174
 
175
  # %% app.ipynb 12
176
+ def create_speech(input_text, model='tts-1', voice='alloy', progress=gr.Progress(), profile: gr.OAuthProfile=None):
177
+ assert authorized(profile) is not None,'Unauthorized M'
178
  # Split the input text into chunks
179
  chunks = split_text(input_text)
180