File size: 39,180 Bytes
24cc4a3
 
 
 
a71e6ad
24cc4a3
 
 
 
a71e6ad
24cc4a3
a71e6ad
 
 
 
 
24cc4a3
a71e6ad
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24cc4a3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a71e6ad
 
 
 
 
 
24cc4a3
 
 
 
 
a71e6ad
24cc4a3
 
 
 
 
 
a71e6ad
 
 
 
 
 
24cc4a3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a71e6ad
24cc4a3
a71e6ad
 
 
 
 
24cc4a3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a71e6ad
24cc4a3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "editable": true,
    "id": "GAEn7ZfhcSLC",
    "outputId": "0eb4e49b-e0bc-41ab-f75a-d404141a1191",
    "slideshow": {
     "slide_type": ""
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Collecting gradio\n",
      "  Obtaining dependency information for gradio from https://files.pythonhosted.org/packages/d8/3c/fcfa9f2f9b97e9c38ccb30eb3edef8acbb284487bc7d8f5b98daf01cf757/gradio-4.12.0-py3-none-any.whl.metadata\n",
      "  Downloading gradio-4.12.0-py3-none-any.whl.metadata (15 kB)\n",
      "Requirement already satisfied: nbdev in /home/agastya/miniforge3/lib/python3.10/site-packages (2.3.13)\n",
      "Collecting aiofiles<24.0,>=22.0 (from gradio)\n",
      "  Obtaining dependency information for aiofiles<24.0,>=22.0 from https://files.pythonhosted.org/packages/c5/19/5af6804c4cc0fed83f47bff6e413a98a36618e7d40185cd36e69737f3b0e/aiofiles-23.2.1-py3-none-any.whl.metadata\n",
      "  Downloading aiofiles-23.2.1-py3-none-any.whl.metadata (9.7 kB)\n",
      "Collecting altair<6.0,>=4.2.0 (from gradio)\n",
      "  Obtaining dependency information for altair<6.0,>=4.2.0 from https://files.pythonhosted.org/packages/c5/e4/7fcceef127badbb0d644d730d992410e4f3799b295c9964a172f92a469c7/altair-5.2.0-py3-none-any.whl.metadata\n",
      "  Downloading altair-5.2.0-py3-none-any.whl.metadata (8.7 kB)\n",
      "Collecting fastapi (from gradio)\n",
      "  Obtaining dependency information for fastapi from https://files.pythonhosted.org/packages/d4/e0/d5d6482e992a1892f3a9a62f6a9154944ae5b276e7da1cf92faa02e3a107/fastapi-0.108.0-py3-none-any.whl.metadata\n",
      "  Downloading fastapi-0.108.0-py3-none-any.whl.metadata (24 kB)\n",
      "Collecting ffmpy (from gradio)\n",
      "  Downloading ffmpy-0.3.1.tar.gz (5.5 kB)\n",
      "  Preparing metadata (setup.py) ... \u001b[?25ldone\n",
      "\u001b[?25hCollecting gradio-client==0.8.0 (from gradio)\n",
      "  Obtaining dependency information for gradio-client==0.8.0 from https://files.pythonhosted.org/packages/c4/e7/5da3a4b6108f5e2e43d034d7923c3562f93beba8f3d13a0ec7c201a6f33c/gradio_client-0.8.0-py3-none-any.whl.metadata\n",
      "  Downloading gradio_client-0.8.0-py3-none-any.whl.metadata (7.1 kB)\n",
      "Collecting httpx (from gradio)\n",
      "  Obtaining dependency information for httpx from https://files.pythonhosted.org/packages/39/9b/4937d841aee9c2c8102d9a4eeb800c7dad25386caabb4a1bf5010df81a57/httpx-0.26.0-py3-none-any.whl.metadata\n",
      "  Downloading httpx-0.26.0-py3-none-any.whl.metadata (7.6 kB)\n",
      "Collecting huggingface-hub>=0.19.3 (from gradio)\n",
      "  Obtaining dependency information for huggingface-hub>=0.19.3 from https://files.pythonhosted.org/packages/a0/0a/02ac0ae1047d97769003ff4fb8e6717024f3f174a5d13257415aa09e13d9/huggingface_hub-0.20.1-py3-none-any.whl.metadata\n",
      "  Downloading huggingface_hub-0.20.1-py3-none-any.whl.metadata (12 kB)\n",
      "Requirement already satisfied: importlib-resources<7.0,>=1.3 in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (6.1.1)\n",
      "Requirement already satisfied: jinja2<4.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (3.1.2)\n",
      "Requirement already satisfied: markupsafe~=2.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (2.1.3)\n",
      "Requirement already satisfied: matplotlib~=3.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (3.8.0)\n",
      "Requirement already satisfied: numpy~=1.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (1.26.2)\n",
      "Collecting orjson~=3.0 (from gradio)\n",
      "  Obtaining dependency information for orjson~=3.0 from https://files.pythonhosted.org/packages/17/e2/7ff96963ba854f0a807fd2783bd7d947ecb0cac7df1d802699727c418aec/orjson-3.9.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata\n",
      "  Downloading orjson-3.9.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (49 kB)\n",
      "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m49.3/49.3 kB\u001b[0m \u001b[31m2.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[?25hRequirement already satisfied: packaging in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (23.1)\n",
      "Requirement already satisfied: pandas<3.0,>=1.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (2.1.4)\n",
      "Requirement already satisfied: pillow<11.0,>=8.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (9.4.0)\n",
      "Requirement already satisfied: pydantic>=2.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (2.5.3)\n",
      "Collecting pydub (from gradio)\n",
      "  Downloading pydub-0.25.1-py2.py3-none-any.whl (32 kB)\n",
      "Collecting python-multipart (from gradio)\n",
      "  Downloading python_multipart-0.0.6-py3-none-any.whl (45 kB)\n",
      "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m45.7/45.7 kB\u001b[0m \u001b[31m6.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[?25hRequirement already satisfied: pyyaml<7.0,>=5.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (6.0.1)\n",
      "Collecting semantic-version~=2.0 (from gradio)\n",
      "  Downloading semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)\n",
      "Collecting tomlkit==0.12.0 (from gradio)\n",
      "  Obtaining dependency information for tomlkit==0.12.0 from https://files.pythonhosted.org/packages/68/4f/12207897848a653d03ebbf6775a29d949408ded5f99b2d87198bc5c93508/tomlkit-0.12.0-py3-none-any.whl.metadata\n",
      "  Downloading tomlkit-0.12.0-py3-none-any.whl.metadata (2.7 kB)\n",
      "Requirement already satisfied: typer[all]<1.0,>=0.9 in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (0.9.0)\n",
      "Requirement already satisfied: typing-extensions~=4.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (4.9.0)\n",
      "Collecting uvicorn>=0.14.0 (from gradio)\n",
      "  Obtaining dependency information for uvicorn>=0.14.0 from https://files.pythonhosted.org/packages/26/59/fddd9df489fe27f492cc97626e03663fb3b9b6ef7ce8597a7cdc5f2cbbad/uvicorn-0.25.0-py3-none-any.whl.metadata\n",
      "  Downloading uvicorn-0.25.0-py3-none-any.whl.metadata (6.4 kB)\n",
      "Collecting fsspec (from gradio-client==0.8.0->gradio)\n",
      "  Obtaining dependency information for fsspec from https://files.pythonhosted.org/packages/70/25/fab23259a52ece5670dcb8452e1af34b89e6135ecc17cd4b54b4b479eac6/fsspec-2023.12.2-py3-none-any.whl.metadata\n",
      "  Downloading fsspec-2023.12.2-py3-none-any.whl.metadata (6.8 kB)\n",
      "Collecting websockets<12.0,>=10.0 (from gradio-client==0.8.0->gradio)\n",
      "  Downloading websockets-11.0.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (129 kB)\n",
      "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m129.9/129.9 kB\u001b[0m \u001b[31m3.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
      "\u001b[?25hRequirement already satisfied: ipywidgets<=8.0.4 in /home/agastya/miniforge3/lib/python3.10/site-packages (from nbdev) (8.0.4)\n",
      "Requirement already satisfied: fastcore>=1.5.27 in /home/agastya/miniforge3/lib/python3.10/site-packages (from nbdev) (1.5.29)\n",
      "Requirement already satisfied: execnb>=0.1.4 in /home/agastya/miniforge3/lib/python3.10/site-packages (from nbdev) (0.1.5)\n",
      "Requirement already satisfied: astunparse in /home/agastya/miniforge3/lib/python3.10/site-packages (from nbdev) (1.6.3)\n",
      "Requirement already satisfied: ghapi>=1.0.3 in /home/agastya/miniforge3/lib/python3.10/site-packages (from nbdev) (1.0.4)\n",
      "Requirement already satisfied: watchdog in /home/agastya/miniforge3/lib/python3.10/site-packages (from nbdev) (3.0.0)\n",
      "Requirement already satisfied: asttokens in /home/agastya/miniforge3/lib/python3.10/site-packages (from nbdev) (2.4.1)\n",
      "Requirement already satisfied: jsonschema>=3.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from altair<6.0,>=4.2.0->gradio) (4.20.0)\n",
      "Requirement already satisfied: toolz in /home/agastya/miniforge3/lib/python3.10/site-packages (from altair<6.0,>=4.2.0->gradio) (0.12.0)\n",
      "Requirement already satisfied: ipython in /home/agastya/miniforge3/lib/python3.10/site-packages (from execnb>=0.1.4->nbdev) (8.19.0)\n",
      "Requirement already satisfied: pip in /home/agastya/miniforge3/lib/python3.10/site-packages (from fastcore>=1.5.27->nbdev) (23.2.1)\n",
      "Requirement already satisfied: filelock in /home/agastya/miniforge3/lib/python3.10/site-packages (from huggingface-hub>=0.19.3->gradio) (3.13.1)\n",
      "Requirement already satisfied: requests in /home/agastya/miniforge3/lib/python3.10/site-packages (from huggingface-hub>=0.19.3->gradio) (2.31.0)\n",
      "Requirement already satisfied: tqdm>=4.42.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from huggingface-hub>=0.19.3->gradio) (4.66.1)\n",
      "Requirement already satisfied: ipykernel>=4.5.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipywidgets<=8.0.4->nbdev) (6.26.0)\n",
      "Requirement already satisfied: traitlets>=4.3.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipywidgets<=8.0.4->nbdev) (5.14.0)\n",
      "Requirement already satisfied: widgetsnbextension~=4.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipywidgets<=8.0.4->nbdev) (4.0.9)\n",
      "Requirement already satisfied: jupyterlab-widgets~=3.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipywidgets<=8.0.4->nbdev) (3.0.9)\n",
      "Requirement already satisfied: contourpy>=1.0.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (1.2.0)\n",
      "Requirement already satisfied: cycler>=0.10 in /home/agastya/miniforge3/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (0.12.1)\n",
      "Requirement already satisfied: fonttools>=4.22.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (4.47.0)\n",
      "Requirement already satisfied: kiwisolver>=1.0.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (1.4.5)\n",
      "Requirement already satisfied: pyparsing>=2.3.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (3.1.1)\n",
      "Requirement already satisfied: python-dateutil>=2.7 in /home/agastya/miniforge3/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (2.8.2)\n",
      "Requirement already satisfied: pytz>=2020.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from pandas<3.0,>=1.0->gradio) (2023.3.post1)\n",
      "Requirement already satisfied: tzdata>=2022.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from pandas<3.0,>=1.0->gradio) (2023.3)\n",
      "Requirement already satisfied: annotated-types>=0.4.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from pydantic>=2.0->gradio) (0.6.0)\n",
      "Requirement already satisfied: pydantic-core==2.14.6 in /home/agastya/miniforge3/lib/python3.10/site-packages (from pydantic>=2.0->gradio) (2.14.6)\n",
      "Requirement already satisfied: click<9.0.0,>=7.1.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from typer[all]<1.0,>=0.9->gradio) (8.1.7)\n",
      "Requirement already satisfied: colorama<0.5.0,>=0.4.3 in /home/agastya/miniforge3/lib/python3.10/site-packages (from typer[all]<1.0,>=0.9->gradio) (0.4.6)\n",
      "Requirement already satisfied: shellingham<2.0.0,>=1.3.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from typer[all]<1.0,>=0.9->gradio) (1.5.4)\n",
      "Requirement already satisfied: rich<14.0.0,>=10.11.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from typer[all]<1.0,>=0.9->gradio) (13.7.0)\n",
      "Collecting h11>=0.8 (from uvicorn>=0.14.0->gradio)\n",
      "  Downloading h11-0.14.0-py3-none-any.whl (58 kB)\n",
      "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m58.3/58.3 kB\u001b[0m \u001b[31m6.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[?25hRequirement already satisfied: six>=1.12.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from asttokens->nbdev) (1.16.0)\n",
      "Requirement already satisfied: wheel<1.0,>=0.23.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from astunparse->nbdev) (0.41.2)\n",
      "Collecting starlette<0.33.0,>=0.29.0 (from fastapi->gradio)\n",
      "  Obtaining dependency information for starlette<0.33.0,>=0.29.0 from https://files.pythonhosted.org/packages/40/9e/6bfa6be40034fa04cc50e2a81d24a4e5b89279c688b51380d70ac31c0556/starlette-0.32.0.post1-py3-none-any.whl.metadata\n",
      "  Downloading starlette-0.32.0.post1-py3-none-any.whl.metadata (5.8 kB)\n",
      "Requirement already satisfied: anyio in /home/agastya/miniforge3/lib/python3.10/site-packages (from httpx->gradio) (4.2.0)\n",
      "Requirement already satisfied: certifi in /home/agastya/miniforge3/lib/python3.10/site-packages (from httpx->gradio) (2023.11.17)\n",
      "Collecting httpcore==1.* (from httpx->gradio)\n",
      "  Obtaining dependency information for httpcore==1.* from https://files.pythonhosted.org/packages/56/ba/78b0a99c4da0ff8b0f59defa2f13ca4668189b134bd9840b6202a93d9a0f/httpcore-1.0.2-py3-none-any.whl.metadata\n",
      "  Downloading httpcore-1.0.2-py3-none-any.whl.metadata (20 kB)\n",
      "Requirement already satisfied: idna in /home/agastya/miniforge3/lib/python3.10/site-packages (from httpx->gradio) (3.4)\n",
      "Requirement already satisfied: sniffio in /home/agastya/miniforge3/lib/python3.10/site-packages (from httpx->gradio) (1.3.0)\n",
      "Requirement already satisfied: comm>=0.1.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (0.1.4)\n",
      "Requirement already satisfied: debugpy>=1.6.5 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (1.8.0)\n",
      "Requirement already satisfied: jupyter-client>=6.1.12 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (8.6.0)\n",
      "Requirement already satisfied: jupyter-core!=5.0.*,>=4.12 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (5.5.1)\n",
      "Requirement already satisfied: matplotlib-inline>=0.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (0.1.6)\n",
      "Requirement already satisfied: nest-asyncio in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (1.5.8)\n",
      "Requirement already satisfied: psutil in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (5.9.7)\n",
      "Requirement already satisfied: pyzmq>=20 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (25.1.2)\n",
      "Requirement already satisfied: tornado>=6.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (6.3.3)\n",
      "Requirement already satisfied: decorator in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipython->execnb>=0.1.4->nbdev) (5.1.1)\n",
      "Requirement already satisfied: jedi>=0.16 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipython->execnb>=0.1.4->nbdev) (0.19.1)\n",
      "Requirement already satisfied: prompt-toolkit<3.1.0,>=3.0.41 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipython->execnb>=0.1.4->nbdev) (3.0.42)\n",
      "Requirement already satisfied: pygments>=2.4.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipython->execnb>=0.1.4->nbdev) (2.17.2)\n",
      "Requirement already satisfied: stack-data in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipython->execnb>=0.1.4->nbdev) (0.6.2)\n",
      "Requirement already satisfied: exceptiongroup in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipython->execnb>=0.1.4->nbdev) (1.2.0)\n",
      "Requirement already satisfied: pexpect>4.3 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipython->execnb>=0.1.4->nbdev) (4.8.0)\n",
      "Requirement already satisfied: attrs>=22.2.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (23.1.0)\n",
      "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /home/agastya/miniforge3/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (2023.11.2)\n",
      "Requirement already satisfied: referencing>=0.28.4 in /home/agastya/miniforge3/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.32.0)\n",
      "Requirement already satisfied: rpds-py>=0.7.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.15.2)\n",
      "Requirement already satisfied: markdown-it-py>=2.2.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from rich<14.0.0,>=10.11.0->typer[all]<1.0,>=0.9->gradio) (3.0.0)\n",
      "Requirement already satisfied: charset-normalizer<4,>=2 in /home/agastya/miniforge3/lib/python3.10/site-packages (from requests->huggingface-hub>=0.19.3->gradio) (3.2.0)\n",
      "Requirement already satisfied: urllib3<3,>=1.21.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from requests->huggingface-hub>=0.19.3->gradio) (2.0.4)\n",
      "Requirement already satisfied: parso<0.9.0,>=0.8.3 in /home/agastya/miniforge3/lib/python3.10/site-packages (from jedi>=0.16->ipython->execnb>=0.1.4->nbdev) (0.8.3)\n",
      "Requirement already satisfied: platformdirs>=2.5 in /home/agastya/miniforge3/lib/python3.10/site-packages (from jupyter-core!=5.0.*,>=4.12->ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (4.1.0)\n",
      "Requirement already satisfied: mdurl~=0.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from markdown-it-py>=2.2.0->rich<14.0.0,>=10.11.0->typer[all]<1.0,>=0.9->gradio) (0.1.0)\n",
      "Requirement already satisfied: ptyprocess>=0.5 in /home/agastya/miniforge3/lib/python3.10/site-packages (from pexpect>4.3->ipython->execnb>=0.1.4->nbdev) (0.7.0)\n",
      "Requirement already satisfied: wcwidth in /home/agastya/miniforge3/lib/python3.10/site-packages (from prompt-toolkit<3.1.0,>=3.0.41->ipython->execnb>=0.1.4->nbdev) (0.2.12)\n",
      "Requirement already satisfied: executing>=1.2.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from stack-data->ipython->execnb>=0.1.4->nbdev) (2.0.1)\n",
      "Requirement already satisfied: pure-eval in /home/agastya/miniforge3/lib/python3.10/site-packages (from stack-data->ipython->execnb>=0.1.4->nbdev) (0.2.2)\n",
      "Downloading gradio-4.12.0-py3-none-any.whl (16.6 MB)\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m16.6/16.6 MB\u001b[0m \u001b[31m5.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
      "\u001b[?25hDownloading gradio_client-0.8.0-py3-none-any.whl (305 kB)\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m305.1/305.1 kB\u001b[0m \u001b[31m6.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
      "\u001b[?25hDownloading tomlkit-0.12.0-py3-none-any.whl (37 kB)\n",
      "Downloading aiofiles-23.2.1-py3-none-any.whl (15 kB)\n",
      "Downloading altair-5.2.0-py3-none-any.whl (996 kB)\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m996.9/996.9 kB\u001b[0m \u001b[31m6.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
      "\u001b[?25hDownloading huggingface_hub-0.20.1-py3-none-any.whl (330 kB)\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m330.1/330.1 kB\u001b[0m \u001b[31m6.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
      "\u001b[?25hDownloading orjson-3.9.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (138 kB)\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m138.7/138.7 kB\u001b[0m \u001b[31m7.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[?25hDownloading uvicorn-0.25.0-py3-none-any.whl (60 kB)\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m60.3/60.3 kB\u001b[0m \u001b[31m6.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[?25hDownloading fastapi-0.108.0-py3-none-any.whl (92 kB)\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m92.0/92.0 kB\u001b[0m \u001b[31m5.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[?25hDownloading httpx-0.26.0-py3-none-any.whl (75 kB)\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m75.9/75.9 kB\u001b[0m \u001b[31m5.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[?25hDownloading httpcore-1.0.2-py3-none-any.whl (76 kB)\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m76.9/76.9 kB\u001b[0m \u001b[31m7.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[?25hDownloading fsspec-2023.12.2-py3-none-any.whl (168 kB)\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m169.0/169.0 kB\u001b[0m \u001b[31m7.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[?25hDownloading starlette-0.32.0.post1-py3-none-any.whl (70 kB)\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m70.0/70.0 kB\u001b[0m \u001b[31m6.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[?25hBuilding wheels for collected packages: ffmpy\n",
      "  Building wheel for ffmpy (setup.py) ... \u001b[?25ldone\n",
      "\u001b[?25h  Created wheel for ffmpy: filename=ffmpy-0.3.1-py3-none-any.whl size=5579 sha256=795f3c4dd1d184ba6162b37602d4e538cac01d79ee2a96270555a769e029a0ec\n",
      "  Stored in directory: /home/agastya/.cache/pip/wheels/01/a6/d1/1c0828c304a4283b2c1639a09ad86f83d7c487ef34c6b4a1bf\n",
      "Successfully built ffmpy\n",
      "Installing collected packages: pydub, ffmpy, websockets, tomlkit, semantic-version, python-multipart, orjson, h11, fsspec, aiofiles, uvicorn, starlette, huggingface-hub, httpcore, httpx, fastapi, gradio-client, altair, gradio\n",
      "Successfully installed aiofiles-23.2.1 altair-5.2.0 fastapi-0.108.0 ffmpy-0.3.1 fsspec-2023.12.2 gradio-4.12.0 gradio-client-0.8.0 h11-0.14.0 httpcore-1.0.2 httpx-0.26.0 huggingface-hub-0.20.1 orjson-3.9.10 pydub-0.25.1 python-multipart-0.0.6 semantic-version-2.10.0 starlette-0.32.0.post1 tomlkit-0.12.0 uvicorn-0.25.0 websockets-11.0.3\n"
     ]
    }
   ],
   "source": [
    "!pip install gradio nbdev"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Collecting nbdev\n",
      "  Obtaining dependency information for nbdev from https://files.pythonhosted.org/packages/45/44/2148be2391edd62b8c88c2114f380141b72276901a53d590be9f769a68e4/nbdev-2.3.13-py3-none-any.whl.metadata\n",
      "  Downloading nbdev-2.3.13-py3-none-any.whl.metadata (10 kB)\n",
      "Collecting ipywidgets<=8.0.4 (from nbdev)\n",
      "  Downloading ipywidgets-8.0.4-py3-none-any.whl (137 kB)\n",
      "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m137.8/137.8 kB\u001b[0m \u001b[31m2.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
      "\u001b[?25hRequirement already satisfied: fastcore>=1.5.27 in /home/agastya/miniforge3/lib/python3.10/site-packages (from nbdev) (1.5.29)\n",
      "Collecting execnb>=0.1.4 (from nbdev)\n",
      "  Downloading execnb-0.1.5-py3-none-any.whl (13 kB)\n",
      "Collecting astunparse (from nbdev)\n",
      "  Downloading astunparse-1.6.3-py2.py3-none-any.whl (12 kB)\n",
      "Collecting ghapi>=1.0.3 (from nbdev)\n",
      "  Obtaining dependency information for ghapi>=1.0.3 from https://files.pythonhosted.org/packages/60/71/064560201c434c22c9f395878ba0f21f9ede8169e61c1a109f26a377bd5e/ghapi-1.0.4-py3-none-any.whl.metadata\n",
      "  Downloading ghapi-1.0.4-py3-none-any.whl.metadata (13 kB)\n",
      "Collecting watchdog (from nbdev)\n",
      "  Downloading watchdog-3.0.0-py3-none-manylinux2014_x86_64.whl (82 kB)\n",
      "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m82.1/82.1 kB\u001b[0m \u001b[31m6.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[?25hRequirement already satisfied: asttokens in /home/agastya/miniforge3/lib/python3.10/site-packages (from nbdev) (2.4.1)\n",
      "Requirement already satisfied: PyYAML in /home/agastya/miniforge3/lib/python3.10/site-packages (from nbdev) (6.0.1)\n",
      "Requirement already satisfied: ipython in /home/agastya/miniforge3/lib/python3.10/site-packages (from execnb>=0.1.4->nbdev) (8.19.0)\n",
      "Requirement already satisfied: pip in /home/agastya/miniforge3/lib/python3.10/site-packages (from fastcore>=1.5.27->nbdev) (23.2.1)\n",
      "Requirement already satisfied: packaging in /home/agastya/miniforge3/lib/python3.10/site-packages (from fastcore>=1.5.27->nbdev) (23.1)\n",
      "Requirement already satisfied: ipykernel>=4.5.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipywidgets<=8.0.4->nbdev) (6.26.0)\n",
      "Requirement already satisfied: traitlets>=4.3.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipywidgets<=8.0.4->nbdev) (5.14.0)\n",
      "Requirement already satisfied: widgetsnbextension~=4.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipywidgets<=8.0.4->nbdev) (4.0.9)\n",
      "Requirement already satisfied: jupyterlab-widgets~=3.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipywidgets<=8.0.4->nbdev) (3.0.9)\n",
      "Requirement already satisfied: six>=1.12.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from asttokens->nbdev) (1.16.0)\n",
      "Requirement already satisfied: wheel<1.0,>=0.23.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from astunparse->nbdev) (0.41.2)\n",
      "Requirement already satisfied: comm>=0.1.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (0.1.4)\n",
      "Requirement already satisfied: debugpy>=1.6.5 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (1.8.0)\n",
      "Requirement already satisfied: jupyter-client>=6.1.12 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (8.6.0)\n",
      "Requirement already satisfied: jupyter-core!=5.0.*,>=4.12 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (5.5.1)\n",
      "Requirement already satisfied: matplotlib-inline>=0.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (0.1.6)\n",
      "Requirement already satisfied: nest-asyncio in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (1.5.8)\n",
      "Requirement already satisfied: psutil in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (5.9.7)\n",
      "Requirement already satisfied: pyzmq>=20 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (25.1.2)\n",
      "Requirement already satisfied: tornado>=6.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (6.3.3)\n",
      "Requirement already satisfied: decorator in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipython->execnb>=0.1.4->nbdev) (5.1.1)\n",
      "Requirement already satisfied: jedi>=0.16 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipython->execnb>=0.1.4->nbdev) (0.19.1)\n",
      "Requirement already satisfied: prompt-toolkit<3.1.0,>=3.0.41 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipython->execnb>=0.1.4->nbdev) (3.0.42)\n",
      "Requirement already satisfied: pygments>=2.4.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipython->execnb>=0.1.4->nbdev) (2.17.2)\n",
      "Requirement already satisfied: stack-data in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipython->execnb>=0.1.4->nbdev) (0.6.2)\n",
      "Requirement already satisfied: exceptiongroup in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipython->execnb>=0.1.4->nbdev) (1.2.0)\n",
      "Requirement already satisfied: pexpect>4.3 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipython->execnb>=0.1.4->nbdev) (4.8.0)\n",
      "Requirement already satisfied: parso<0.9.0,>=0.8.3 in /home/agastya/miniforge3/lib/python3.10/site-packages (from jedi>=0.16->ipython->execnb>=0.1.4->nbdev) (0.8.3)\n",
      "Requirement already satisfied: python-dateutil>=2.8.2 in /home/agastya/miniforge3/lib/python3.10/site-packages (from jupyter-client>=6.1.12->ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (2.8.2)\n",
      "Requirement already satisfied: platformdirs>=2.5 in /home/agastya/miniforge3/lib/python3.10/site-packages (from jupyter-core!=5.0.*,>=4.12->ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (4.1.0)\n",
      "Requirement already satisfied: ptyprocess>=0.5 in /home/agastya/miniforge3/lib/python3.10/site-packages (from pexpect>4.3->ipython->execnb>=0.1.4->nbdev) (0.7.0)\n",
      "Requirement already satisfied: wcwidth in /home/agastya/miniforge3/lib/python3.10/site-packages (from prompt-toolkit<3.1.0,>=3.0.41->ipython->execnb>=0.1.4->nbdev) (0.2.12)\n",
      "Requirement already satisfied: executing>=1.2.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from stack-data->ipython->execnb>=0.1.4->nbdev) (2.0.1)\n",
      "Requirement already satisfied: pure-eval in /home/agastya/miniforge3/lib/python3.10/site-packages (from stack-data->ipython->execnb>=0.1.4->nbdev) (0.2.2)\n",
      "Downloading nbdev-2.3.13-py3-none-any.whl (66 kB)\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m66.1/66.1 kB\u001b[0m \u001b[31m5.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[?25hDownloading ghapi-1.0.4-py3-none-any.whl (58 kB)\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m58.7/58.7 kB\u001b[0m \u001b[31m6.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[?25hInstalling collected packages: watchdog, astunparse, ghapi, execnb, ipywidgets, nbdev\n",
      "  Attempting uninstall: ipywidgets\n",
      "    Found existing installation: ipywidgets 8.1.1\n",
      "    Uninstalling ipywidgets-8.1.1:\n",
      "      Successfully uninstalled ipywidgets-8.1.1\n",
      "Successfully installed astunparse-1.6.3 execnb-0.1.5 ghapi-1.0.4 ipywidgets-8.0.4 nbdev-2.3.13 watchdog-3.0.0\n"
     ]
    }
   ],
   "source": [
    "!pip install nbdev"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "S2uYQd3pexuE",
    "outputId": "fbb28fa7-14a7-4446-ed63-75cd98bf6dc2"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m719.8/719.8 kB\u001b[0m \u001b[31m2.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m507.1/507.1 kB\u001b[0m \u001b[31m8.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.3/1.3 MB\u001b[0m \u001b[31m12.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m115.3/115.3 kB\u001b[0m \u001b[31m13.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m134.8/134.8 kB\u001b[0m \u001b[31m12.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[?25hMounted at /content/gdrive\n"
     ]
    }
   ],
   "source": [
    "# Required for fetching files from gDrive\n",
    "! [ -e /content ] && pip install -Uqq fastbook\n",
    "import fastbook\n",
    "fastbook.setup_book()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "id": "Ivzb1m1Ub2y5"
   },
   "outputs": [],
   "source": [
    "#|default_exp app"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "id": "xL1Hpue4cDms"
   },
   "outputs": [],
   "source": [
    "#|export\n",
    "# importing dependencies\n",
    "from fastai.vision.all import *\n",
    "import gradio as gr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "editable": true,
    "id": "nc2O48TScW_7",
    "slideshow": {
     "slide_type": ""
    },
    "tags": []
   },
   "outputs": [],
   "source": [
    "#|export\n",
    "# creating inference\n",
    "learn = load_learner('content/bearClassifier.pkl')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "editable": true,
    "id": "dGC3UmI4c3QY",
    "slideshow": {
     "slide_type": ""
    },
    "tags": []
   },
   "outputs": [],
   "source": [
    "#|export\n",
    "categories = ('Black', 'Grizzly', 'Teddy')\n",
    "\n",
    "def classify_image(img):\n",
    "  pred, idx, probs = learn.predict(img)\n",
    "  return dict(zip(categories, map(float, probs)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 646
    },
    "editable": true,
    "id": "jLrBazuoddxB",
    "outputId": "7665b29e-7489-469f-ac00-dbd90d9bbe0c",
    "slideshow": {
     "slide_type": ""
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Setting queue=True in a Colab notebook requires sharing enabled. Setting `share=True` (you can turn this off by setting `share=False` in `launch()` explicitly).\n",
      "\n",
      "Colab notebook detected. To show errors in colab notebook, set debug=True in launch()\n",
      "Running on public URL: https://d10d07b14c3e9bde1d.gradio.live\n",
      "\n",
      "This share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div><iframe src=\"https://d10d07b14c3e9bde1d.gradio.live\" width=\"100%\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#|export\n",
    "# gradio interface Setup\n",
    "image = gr.Image()\n",
    "label = gr.Label()\n",
    "examples = ['content/bear1.jpg', 'content/bear2.jpg', 'content/bear3.jpg', 'content/bear4.jpg']\n",
    "\n",
    "intf = gr.Interface(fn = classify_image, inputs = image, outputs = label, examples = examples).launch()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 131
    },
    "id": "gevfj4iakJLP",
    "outputId": "6bf44a0f-8cee-4618-b0b6-35c4f51d12dc"
   },
   "outputs": [],
   "source": [
    "import nbdev\n",
    "# doc(nbdev.export.nb_export)\n",
    "nbdev.export.nb_export('02_BearClassifierDeployment.ipynb', './')"
   ]
  }
 ],
 "metadata": {
  "colab": {
   "provenance": []
  },
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}