Fedir Zadniprovskyi commited on
Commit
b995db6
·
1 Parent(s): 23ca7f9

feat: add mvp client which runs in the background

Browse files
Files changed (5) hide show
  1. pyproject.toml +14 -3
  2. requirements-all.txt +23 -45
  3. requirements-dev.txt +36 -84
  4. requirements.txt +35 -83
  5. scripts/client.py +79 -0
pyproject.toml CHANGED
@@ -14,11 +14,21 @@ dependencies = [
14
  "httpx-sse",
15
  "httpx",
16
  "gradio",
17
- "openai"
18
  ]
19
 
20
  [project.optional-dependencies]
21
- dev = ["ruff==0.5.3", "pytest", "webvtt-py", "srt", "basedpyright==1.13.0", "pytest-xdist"]
 
 
 
 
 
 
 
 
 
 
22
 
23
  other = ["youtube-dl @ git+https://github.com/ytdl-org/youtube-dl.git@37cea84f775129ad715b9bcd617251c831fcc980", "aider-chat==0.39.0"]
24
 
@@ -58,7 +68,8 @@ ignore = [
58
  "T201", # print
59
  "TRY003",
60
  "W505",
61
- "ISC001" # recommended to disable for formatting
 
62
  ]
63
 
64
  [tool.ruff.lint.isort]
 
14
  "httpx-sse",
15
  "httpx",
16
  "gradio",
17
+ "openai",
18
  ]
19
 
20
  [project.optional-dependencies]
21
+ client = [
22
+ "keyboard",
23
+ ]
24
+ dev = [
25
+ "ruff==0.5.3",
26
+ "pytest",
27
+ "webvtt-py",
28
+ "srt",
29
+ "basedpyright==1.13.0",
30
+ "pytest-xdist"
31
+ ]
32
 
33
  other = ["youtube-dl @ git+https://github.com/ytdl-org/youtube-dl.git@37cea84f775129ad715b9bcd617251c831fcc980", "aider-chat==0.39.0"]
34
 
 
68
  "T201", # print
69
  "TRY003",
70
  "W505",
71
+ "ISC001", # recommended to disable for formatting
72
+ "INP001",
73
  ]
74
 
75
  [tool.ruff.lint.isort]
requirements-all.txt CHANGED
@@ -15,7 +15,6 @@ aiosignal==1.3.1
15
  altair==5.3.0
16
  # via
17
  # aider-chat
18
- # gradio
19
  # streamlit
20
  annotated-types==0.7.0
21
  # via
@@ -24,17 +23,17 @@ annotated-types==0.7.0
24
  anyio==4.4.0
25
  # via
26
  # aider-chat
 
27
  # httpx
28
  # openai
29
  # starlette
30
- # watchfiles
31
  attrs==23.2.0
32
  # via
33
  # aider-chat
34
  # aiohttp
35
  # jsonschema
36
  # referencing
37
- av==12.2.0
38
  # via faster-whisper
39
  backoff==2.2.1
40
  # via aider-chat
@@ -91,21 +90,15 @@ distro==1.9.0
91
  # via
92
  # aider-chat
93
  # openai
94
- dnspython==2.6.1
95
- # via email-validator
96
- email-validator==2.2.0
97
- # via fastapi
98
  execnet==2.1.1
99
  # via pytest-xdist
100
- fastapi==0.111.1
101
  # via
102
  # faster-whisper-server (pyproject.toml)
103
  # gradio
104
- fastapi-cli==0.0.4
105
- # via fastapi
106
  faster-whisper==1.0.3
107
  # via faster-whisper-server (pyproject.toml)
108
- ffmpy==0.3.2
109
  # via gradio
110
  filelock==3.15.1
111
  # via
@@ -168,9 +161,9 @@ googleapis-common-protos==1.63.1
168
  # aider-chat
169
  # google-api-core
170
  # grpcio-status
171
- gradio==4.38.1
172
  # via faster-whisper-server (pyproject.toml)
173
- gradio-client==1.1.0
174
  # via gradio
175
  greenlet==3.0.3
176
  # via
@@ -201,13 +194,10 @@ httplib2==0.22.0
201
  # aider-chat
202
  # google-api-python-client
203
  # google-auth-httplib2
204
- httptools==0.6.1
205
- # via uvicorn
206
  httpx==0.27.0
207
  # via
208
  # faster-whisper-server (pyproject.toml)
209
  # aider-chat
210
- # fastapi
211
  # gradio
212
  # gradio-client
213
  # openai
@@ -227,7 +217,6 @@ idna==3.7
227
  # via
228
  # aider-chat
229
  # anyio
230
- # email-validator
231
  # httpx
232
  # requests
233
  # yarl
@@ -235,7 +224,7 @@ importlib-metadata==7.1.0
235
  # via
236
  # aider-chat
237
  # litellm
238
- importlib-resources==6.4.0
239
  # via gradio
240
  iniconfig==2.0.0
241
  # via pytest
@@ -243,7 +232,6 @@ jinja2==3.1.4
243
  # via
244
  # aider-chat
245
  # altair
246
- # fastapi
247
  # gradio
248
  # litellm
249
  # pydeck
@@ -255,6 +243,8 @@ jsonschema-specifications==2023.12.1
255
  # via
256
  # aider-chat
257
  # jsonschema
 
 
258
  kiwisolver==1.4.5
259
  # via matplotlib
260
  litellm==1.40.15
@@ -268,7 +258,7 @@ markupsafe==2.1.5
268
  # aider-chat
269
  # gradio
270
  # jinja2
271
- matplotlib==3.9.1
272
  # via gradio
273
  mccabe==0.7.0
274
  # via
@@ -287,7 +277,7 @@ multidict==6.0.5
287
  # yarl
288
  networkx==3.2.1
289
  # via aider-chat
290
- nodejs-wheel-binaries==20.15.1
291
  # via basedpyright
292
  numpy==1.26.4
293
  # via
@@ -304,14 +294,14 @@ numpy==1.26.4
304
  # pydeck
305
  # scipy
306
  # streamlit
307
- onnxruntime==1.18.1
308
  # via faster-whisper
309
  openai==1.34.0
310
  # via
311
  # faster-whisper-server (pyproject.toml)
312
  # aider-chat
313
  # litellm
314
- orjson==3.10.6
315
  # via gradio
316
  packaging==24.1
317
  # via
@@ -397,7 +387,7 @@ pydantic-core==2.18.4
397
  # via
398
  # aider-chat
399
  # pydantic
400
- pydantic-settings==2.3.4
401
  # via faster-whisper-server (pyproject.toml)
402
  pydeck==0.9.1
403
  # via
@@ -424,7 +414,7 @@ pyparsing==3.1.2
424
  # aider-chat
425
  # httplib2
426
  # matplotlib
427
- pytest==8.2.2
428
  # via
429
  # faster-whisper-server (pyproject.toml)
430
  # pytest-xdist
@@ -440,11 +430,9 @@ python-dotenv==1.0.1
440
  # aider-chat
441
  # litellm
442
  # pydantic-settings
443
- # uvicorn
444
  python-multipart==0.0.9
445
  # via
446
  # faster-whisper-server (pyproject.toml)
447
- # fastapi
448
  # gradio
449
  pytz==2024.1
450
  # via
@@ -456,7 +444,6 @@ pyyaml==6.0.1
456
  # ctranslate2
457
  # gradio
458
  # huggingface-hub
459
- # uvicorn
460
  referencing==0.35.1
461
  # via
462
  # aider-chat
@@ -496,7 +483,7 @@ scipy==1.13.1
496
  # via aider-chat
497
  semantic-version==2.10.0
498
  # via gradio
499
- setuptools==71.0.4
500
  # via ctranslate2
501
  shellingham==1.5.4
502
  # via typer
@@ -526,11 +513,11 @@ soupsieve==2.5
526
  # beautifulsoup4
527
  srt==3.5.3
528
  # via faster-whisper-server (pyproject.toml)
529
- starlette==0.37.2
530
  # via fastapi
531
  streamlit==1.35.0
532
  # via aider-chat
533
- sympy==1.13.1
534
  # via onnxruntime
535
  tenacity==8.3.0
536
  # via
@@ -573,10 +560,8 @@ tree-sitter-languages==1.10.2
573
  # via
574
  # aider-chat
575
  # grep-ast
576
- typer==0.12.3
577
- # via
578
- # fastapi-cli
579
- # gradio
580
  typing-extensions==4.12.2
581
  # via
582
  # aider-chat
@@ -604,27 +589,20 @@ urllib3==2.2.1
604
  # aider-chat
605
  # gradio
606
  # requests
607
- uvicorn==0.30.1
608
  # via
609
  # faster-whisper-server (pyproject.toml)
610
- # fastapi
611
  # gradio
612
- uvloop==0.19.0
613
- # via uvicorn
614
  watchdog==4.0.1
615
  # via
616
  # aider-chat
617
  # streamlit
618
- watchfiles==0.22.0
619
- # via uvicorn
620
  wcwidth==0.2.13
621
  # via
622
  # aider-chat
623
  # prompt-toolkit
624
- websockets==11.0.3
625
- # via
626
- # gradio-client
627
- # uvicorn
628
  webvtt-py==0.5.1
629
  # via faster-whisper-server (pyproject.toml)
630
  yarl==1.9.4
 
15
  altair==5.3.0
16
  # via
17
  # aider-chat
 
18
  # streamlit
19
  annotated-types==0.7.0
20
  # via
 
23
  anyio==4.4.0
24
  # via
25
  # aider-chat
26
+ # gradio
27
  # httpx
28
  # openai
29
  # starlette
 
30
  attrs==23.2.0
31
  # via
32
  # aider-chat
33
  # aiohttp
34
  # jsonschema
35
  # referencing
36
+ av==12.3.0
37
  # via faster-whisper
38
  backoff==2.2.1
39
  # via aider-chat
 
90
  # via
91
  # aider-chat
92
  # openai
 
 
 
 
93
  execnet==2.1.1
94
  # via pytest-xdist
95
+ fastapi==0.112.2
96
  # via
97
  # faster-whisper-server (pyproject.toml)
98
  # gradio
 
 
99
  faster-whisper==1.0.3
100
  # via faster-whisper-server (pyproject.toml)
101
+ ffmpy==0.4.0
102
  # via gradio
103
  filelock==3.15.1
104
  # via
 
161
  # aider-chat
162
  # google-api-core
163
  # grpcio-status
164
+ gradio==4.42.0
165
  # via faster-whisper-server (pyproject.toml)
166
+ gradio-client==1.3.0
167
  # via gradio
168
  greenlet==3.0.3
169
  # via
 
194
  # aider-chat
195
  # google-api-python-client
196
  # google-auth-httplib2
 
 
197
  httpx==0.27.0
198
  # via
199
  # faster-whisper-server (pyproject.toml)
200
  # aider-chat
 
201
  # gradio
202
  # gradio-client
203
  # openai
 
217
  # via
218
  # aider-chat
219
  # anyio
 
220
  # httpx
221
  # requests
222
  # yarl
 
224
  # via
225
  # aider-chat
226
  # litellm
227
+ importlib-resources==6.4.4
228
  # via gradio
229
  iniconfig==2.0.0
230
  # via pytest
 
232
  # via
233
  # aider-chat
234
  # altair
 
235
  # gradio
236
  # litellm
237
  # pydeck
 
243
  # via
244
  # aider-chat
245
  # jsonschema
246
+ keyboard==0.13.5
247
+ # via faster-whisper-server (pyproject.toml)
248
  kiwisolver==1.4.5
249
  # via matplotlib
250
  litellm==1.40.15
 
258
  # aider-chat
259
  # gradio
260
  # jinja2
261
+ matplotlib==3.9.2
262
  # via gradio
263
  mccabe==0.7.0
264
  # via
 
277
  # yarl
278
  networkx==3.2.1
279
  # via aider-chat
280
+ nodejs-wheel-binaries==20.17.0
281
  # via basedpyright
282
  numpy==1.26.4
283
  # via
 
294
  # pydeck
295
  # scipy
296
  # streamlit
297
+ onnxruntime==1.19.0
298
  # via faster-whisper
299
  openai==1.34.0
300
  # via
301
  # faster-whisper-server (pyproject.toml)
302
  # aider-chat
303
  # litellm
304
+ orjson==3.10.7
305
  # via gradio
306
  packaging==24.1
307
  # via
 
387
  # via
388
  # aider-chat
389
  # pydantic
390
+ pydantic-settings==2.4.0
391
  # via faster-whisper-server (pyproject.toml)
392
  pydeck==0.9.1
393
  # via
 
414
  # aider-chat
415
  # httplib2
416
  # matplotlib
417
+ pytest==8.3.2
418
  # via
419
  # faster-whisper-server (pyproject.toml)
420
  # pytest-xdist
 
430
  # aider-chat
431
  # litellm
432
  # pydantic-settings
 
433
  python-multipart==0.0.9
434
  # via
435
  # faster-whisper-server (pyproject.toml)
 
436
  # gradio
437
  pytz==2024.1
438
  # via
 
444
  # ctranslate2
445
  # gradio
446
  # huggingface-hub
 
447
  referencing==0.35.1
448
  # via
449
  # aider-chat
 
483
  # via aider-chat
484
  semantic-version==2.10.0
485
  # via gradio
486
+ setuptools==73.0.1
487
  # via ctranslate2
488
  shellingham==1.5.4
489
  # via typer
 
513
  # beautifulsoup4
514
  srt==3.5.3
515
  # via faster-whisper-server (pyproject.toml)
516
+ starlette==0.38.2
517
  # via fastapi
518
  streamlit==1.35.0
519
  # via aider-chat
520
+ sympy==1.13.2
521
  # via onnxruntime
522
  tenacity==8.3.0
523
  # via
 
560
  # via
561
  # aider-chat
562
  # grep-ast
563
+ typer==0.12.5
564
+ # via gradio
 
 
565
  typing-extensions==4.12.2
566
  # via
567
  # aider-chat
 
589
  # aider-chat
590
  # gradio
591
  # requests
592
+ uvicorn==0.30.6
593
  # via
594
  # faster-whisper-server (pyproject.toml)
 
595
  # gradio
 
 
596
  watchdog==4.0.1
597
  # via
598
  # aider-chat
599
  # streamlit
 
 
600
  wcwidth==0.2.13
601
  # via
602
  # aider-chat
603
  # prompt-toolkit
604
+ websockets==12.0
605
+ # via gradio-client
 
 
606
  webvtt-py==0.5.1
607
  # via faster-whisper-server (pyproject.toml)
608
  yarl==1.9.4
requirements-dev.txt CHANGED
@@ -2,21 +2,15 @@
2
  # uv pip compile --override overrides.txt --extra dev pyproject.toml
3
  aiofiles==23.2.1
4
  # via gradio
5
- altair==5.3.0
6
- # via gradio
7
  annotated-types==0.7.0
8
  # via pydantic
9
  anyio==4.4.0
10
  # via
 
11
  # httpx
12
  # openai
13
  # starlette
14
- # watchfiles
15
- attrs==23.2.0
16
- # via
17
- # jsonschema
18
- # referencing
19
- av==12.2.0
20
  # via faster-whisper
21
  basedpyright==1.13.0
22
  # via faster-whisper-server (pyproject.toml)
@@ -25,7 +19,7 @@ certifi==2024.7.4
25
  # httpcore
26
  # httpx
27
  # requests
28
- cffi==1.16.0
29
  # via soundfile
30
  charset-normalizer==3.3.2
31
  # via requests
@@ -43,21 +37,15 @@ cycler==0.12.1
43
  # via matplotlib
44
  distro==1.9.0
45
  # via openai
46
- dnspython==2.6.1
47
- # via email-validator
48
- email-validator==2.2.0
49
- # via fastapi
50
  execnet==2.1.1
51
  # via pytest-xdist
52
- fastapi==0.111.1
53
  # via
54
  # faster-whisper-server (pyproject.toml)
55
  # gradio
56
- fastapi-cli==0.0.4
57
- # via fastapi
58
  faster-whisper==1.0.3
59
  # via faster-whisper-server (pyproject.toml)
60
- ffmpy==0.3.2
61
  # via gradio
62
  filelock==3.15.4
63
  # via huggingface-hub
@@ -69,9 +57,9 @@ fsspec==2024.6.1
69
  # via
70
  # gradio-client
71
  # huggingface-hub
72
- gradio==4.38.1
73
  # via faster-whisper-server (pyproject.toml)
74
- gradio-client==1.1.0
75
  # via gradio
76
  h11==0.14.0
77
  # via
@@ -79,18 +67,15 @@ h11==0.14.0
79
  # uvicorn
80
  httpcore==1.0.5
81
  # via httpx
82
- httptools==0.6.1
83
- # via uvicorn
84
  httpx==0.27.0
85
  # via
86
  # faster-whisper-server (pyproject.toml)
87
- # fastapi
88
  # gradio
89
  # gradio-client
90
  # openai
91
  httpx-sse==0.4.0
92
  # via faster-whisper-server (pyproject.toml)
93
- huggingface-hub==0.24.0
94
  # via
95
  # faster-whisper-server (pyproject.toml)
96
  # faster-whisper
@@ -99,25 +84,19 @@ huggingface-hub==0.24.0
99
  # tokenizers
100
  humanfriendly==10.0
101
  # via coloredlogs
102
- idna==3.7
103
  # via
104
  # anyio
105
- # email-validator
106
  # httpx
107
  # requests
108
- importlib-resources==6.4.0
109
  # via gradio
110
  iniconfig==2.0.0
111
  # via pytest
112
  jinja2==3.1.4
113
- # via
114
- # altair
115
- # fastapi
116
- # gradio
117
- jsonschema==4.23.0
118
- # via altair
119
- jsonschema-specifications==2023.12.1
120
- # via jsonschema
121
  kiwisolver==1.4.5
122
  # via matplotlib
123
  markdown-it-py==3.0.0
@@ -126,33 +105,31 @@ markupsafe==2.1.5
126
  # via
127
  # gradio
128
  # jinja2
129
- matplotlib==3.9.1
130
  # via gradio
131
  mdurl==0.1.2
132
  # via markdown-it-py
133
  mpmath==1.3.0
134
  # via sympy
135
- nodejs-wheel-binaries==20.15.1
136
  # via basedpyright
137
  numpy==1.26.4
138
  # via
139
  # faster-whisper-server (pyproject.toml)
140
- # altair
141
  # contourpy
142
  # ctranslate2
143
  # gradio
144
  # matplotlib
145
  # onnxruntime
146
  # pandas
147
- onnxruntime==1.18.1
148
  # via faster-whisper
149
- openai==1.36.0
150
  # via faster-whisper-server (pyproject.toml)
151
- orjson==3.10.6
152
  # via gradio
153
  packaging==24.1
154
  # via
155
- # altair
156
  # gradio
157
  # gradio-client
158
  # huggingface-hub
@@ -160,16 +137,14 @@ packaging==24.1
160
  # onnxruntime
161
  # pytest
162
  pandas==2.2.2
163
- # via
164
- # altair
165
- # gradio
166
  pillow==10.4.0
167
  # via
168
  # gradio
169
  # matplotlib
170
  pluggy==1.5.0
171
  # via pytest
172
- protobuf==5.27.2
173
  # via onnxruntime
174
  pycparser==2.22
175
  # via cffi
@@ -182,15 +157,15 @@ pydantic==2.8.2
182
  # pydantic-settings
183
  pydantic-core==2.20.1
184
  # via pydantic
185
- pydantic-settings==2.3.4
186
  # via faster-whisper-server (pyproject.toml)
187
  pydub==0.25.1
188
  # via gradio
189
  pygments==2.18.0
190
  # via rich
191
- pyparsing==3.1.2
192
  # via matplotlib
193
- pytest==8.2.2
194
  # via
195
  # faster-whisper-server (pyproject.toml)
196
  # pytest-xdist
@@ -201,41 +176,29 @@ python-dateutil==2.9.0.post0
201
  # matplotlib
202
  # pandas
203
  python-dotenv==1.0.1
204
- # via
205
- # pydantic-settings
206
- # uvicorn
207
  python-multipart==0.0.9
208
  # via
209
  # faster-whisper-server (pyproject.toml)
210
- # fastapi
211
  # gradio
212
  pytz==2024.1
213
  # via pandas
214
- pyyaml==6.0.1
215
  # via
216
  # ctranslate2
217
  # gradio
218
  # huggingface-hub
219
- # uvicorn
220
- referencing==0.35.1
221
- # via
222
- # jsonschema
223
- # jsonschema-specifications
224
  requests==2.32.3
225
  # via huggingface-hub
226
- rich==13.7.1
227
  # via typer
228
- rpds-py==0.19.0
229
- # via
230
- # jsonschema
231
- # referencing
232
  ruff==0.5.3
233
  # via
234
  # faster-whisper-server (pyproject.toml)
235
  # gradio
236
  semantic-version==2.10.0
237
  # via gradio
238
- setuptools==71.0.4
239
  # via ctranslate2
240
  shellingham==1.5.4
241
  # via typer
@@ -250,24 +213,20 @@ soundfile==0.12.1
250
  # via faster-whisper-server (pyproject.toml)
251
  srt==3.5.3
252
  # via faster-whisper-server (pyproject.toml)
253
- starlette==0.37.2
254
  # via fastapi
255
- sympy==1.13.1
256
  # via onnxruntime
257
- tokenizers==0.19.1
258
  # via faster-whisper
259
  tomlkit==0.12.0
260
  # via gradio
261
- toolz==0.12.1
262
- # via altair
263
- tqdm==4.66.4
264
  # via
265
  # huggingface-hub
266
  # openai
267
- typer==0.12.3
268
- # via
269
- # fastapi-cli
270
- # gradio
271
  typing-extensions==4.12.2
272
  # via
273
  # fastapi
@@ -284,18 +243,11 @@ urllib3==2.2.2
284
  # via
285
  # gradio
286
  # requests
287
- uvicorn==0.30.1
288
  # via
289
  # faster-whisper-server (pyproject.toml)
290
- # fastapi
291
  # gradio
292
- uvloop==0.19.0
293
- # via uvicorn
294
- watchfiles==0.22.0
295
- # via uvicorn
296
- websockets==11.0.3
297
- # via
298
- # gradio-client
299
- # uvicorn
300
  webvtt-py==0.5.1
301
  # via faster-whisper-server (pyproject.toml)
 
2
  # uv pip compile --override overrides.txt --extra dev pyproject.toml
3
  aiofiles==23.2.1
4
  # via gradio
 
 
5
  annotated-types==0.7.0
6
  # via pydantic
7
  anyio==4.4.0
8
  # via
9
+ # gradio
10
  # httpx
11
  # openai
12
  # starlette
13
+ av==12.3.0
 
 
 
 
 
14
  # via faster-whisper
15
  basedpyright==1.13.0
16
  # via faster-whisper-server (pyproject.toml)
 
19
  # httpcore
20
  # httpx
21
  # requests
22
+ cffi==1.17.0
23
  # via soundfile
24
  charset-normalizer==3.3.2
25
  # via requests
 
37
  # via matplotlib
38
  distro==1.9.0
39
  # via openai
 
 
 
 
40
  execnet==2.1.1
41
  # via pytest-xdist
42
+ fastapi==0.112.2
43
  # via
44
  # faster-whisper-server (pyproject.toml)
45
  # gradio
 
 
46
  faster-whisper==1.0.3
47
  # via faster-whisper-server (pyproject.toml)
48
+ ffmpy==0.4.0
49
  # via gradio
50
  filelock==3.15.4
51
  # via huggingface-hub
 
57
  # via
58
  # gradio-client
59
  # huggingface-hub
60
+ gradio==4.42.0
61
  # via faster-whisper-server (pyproject.toml)
62
+ gradio-client==1.3.0
63
  # via gradio
64
  h11==0.14.0
65
  # via
 
67
  # uvicorn
68
  httpcore==1.0.5
69
  # via httpx
 
 
70
  httpx==0.27.0
71
  # via
72
  # faster-whisper-server (pyproject.toml)
 
73
  # gradio
74
  # gradio-client
75
  # openai
76
  httpx-sse==0.4.0
77
  # via faster-whisper-server (pyproject.toml)
78
+ huggingface-hub==0.24.6
79
  # via
80
  # faster-whisper-server (pyproject.toml)
81
  # faster-whisper
 
84
  # tokenizers
85
  humanfriendly==10.0
86
  # via coloredlogs
87
+ idna==3.8
88
  # via
89
  # anyio
 
90
  # httpx
91
  # requests
92
+ importlib-resources==6.4.4
93
  # via gradio
94
  iniconfig==2.0.0
95
  # via pytest
96
  jinja2==3.1.4
97
+ # via gradio
98
+ jiter==0.5.0
99
+ # via openai
 
 
 
 
 
100
  kiwisolver==1.4.5
101
  # via matplotlib
102
  markdown-it-py==3.0.0
 
105
  # via
106
  # gradio
107
  # jinja2
108
+ matplotlib==3.9.2
109
  # via gradio
110
  mdurl==0.1.2
111
  # via markdown-it-py
112
  mpmath==1.3.0
113
  # via sympy
114
+ nodejs-wheel-binaries==20.17.0
115
  # via basedpyright
116
  numpy==1.26.4
117
  # via
118
  # faster-whisper-server (pyproject.toml)
 
119
  # contourpy
120
  # ctranslate2
121
  # gradio
122
  # matplotlib
123
  # onnxruntime
124
  # pandas
125
+ onnxruntime==1.19.0
126
  # via faster-whisper
127
+ openai==1.42.0
128
  # via faster-whisper-server (pyproject.toml)
129
+ orjson==3.10.7
130
  # via gradio
131
  packaging==24.1
132
  # via
 
133
  # gradio
134
  # gradio-client
135
  # huggingface-hub
 
137
  # onnxruntime
138
  # pytest
139
  pandas==2.2.2
140
+ # via gradio
 
 
141
  pillow==10.4.0
142
  # via
143
  # gradio
144
  # matplotlib
145
  pluggy==1.5.0
146
  # via pytest
147
+ protobuf==5.27.3
148
  # via onnxruntime
149
  pycparser==2.22
150
  # via cffi
 
157
  # pydantic-settings
158
  pydantic-core==2.20.1
159
  # via pydantic
160
+ pydantic-settings==2.4.0
161
  # via faster-whisper-server (pyproject.toml)
162
  pydub==0.25.1
163
  # via gradio
164
  pygments==2.18.0
165
  # via rich
166
+ pyparsing==3.1.4
167
  # via matplotlib
168
+ pytest==8.3.2
169
  # via
170
  # faster-whisper-server (pyproject.toml)
171
  # pytest-xdist
 
176
  # matplotlib
177
  # pandas
178
  python-dotenv==1.0.1
179
+ # via pydantic-settings
 
 
180
  python-multipart==0.0.9
181
  # via
182
  # faster-whisper-server (pyproject.toml)
 
183
  # gradio
184
  pytz==2024.1
185
  # via pandas
186
+ pyyaml==6.0.2
187
  # via
188
  # ctranslate2
189
  # gradio
190
  # huggingface-hub
 
 
 
 
 
191
  requests==2.32.3
192
  # via huggingface-hub
193
+ rich==13.8.0
194
  # via typer
 
 
 
 
195
  ruff==0.5.3
196
  # via
197
  # faster-whisper-server (pyproject.toml)
198
  # gradio
199
  semantic-version==2.10.0
200
  # via gradio
201
+ setuptools==73.0.1
202
  # via ctranslate2
203
  shellingham==1.5.4
204
  # via typer
 
213
  # via faster-whisper-server (pyproject.toml)
214
  srt==3.5.3
215
  # via faster-whisper-server (pyproject.toml)
216
+ starlette==0.38.2
217
  # via fastapi
218
+ sympy==1.13.2
219
  # via onnxruntime
220
+ tokenizers==0.20.0
221
  # via faster-whisper
222
  tomlkit==0.12.0
223
  # via gradio
224
+ tqdm==4.66.5
 
 
225
  # via
226
  # huggingface-hub
227
  # openai
228
+ typer==0.12.5
229
+ # via gradio
 
 
230
  typing-extensions==4.12.2
231
  # via
232
  # fastapi
 
243
  # via
244
  # gradio
245
  # requests
246
+ uvicorn==0.30.6
247
  # via
248
  # faster-whisper-server (pyproject.toml)
 
249
  # gradio
250
+ websockets==12.0
251
+ # via gradio-client
 
 
 
 
 
 
252
  webvtt-py==0.5.1
253
  # via faster-whisper-server (pyproject.toml)
requirements.txt CHANGED
@@ -2,28 +2,22 @@
2
  # uv pip compile --override overrides.txt pyproject.toml
3
  aiofiles==23.2.1
4
  # via gradio
5
- altair==5.3.0
6
- # via gradio
7
  annotated-types==0.7.0
8
  # via pydantic
9
  anyio==4.4.0
10
  # via
 
11
  # httpx
12
  # openai
13
  # starlette
14
- # watchfiles
15
- attrs==23.2.0
16
- # via
17
- # jsonschema
18
- # referencing
19
- av==12.2.0
20
  # via faster-whisper
21
  certifi==2024.7.4
22
  # via
23
  # httpcore
24
  # httpx
25
  # requests
26
- cffi==1.16.0
27
  # via soundfile
28
  charset-normalizer==3.3.2
29
  # via requests
@@ -41,19 +35,13 @@ cycler==0.12.1
41
  # via matplotlib
42
  distro==1.9.0
43
  # via openai
44
- dnspython==2.6.1
45
- # via email-validator
46
- email-validator==2.2.0
47
- # via fastapi
48
- fastapi==0.111.1
49
  # via
50
  # faster-whisper-server (pyproject.toml)
51
  # gradio
52
- fastapi-cli==0.0.4
53
- # via fastapi
54
  faster-whisper==1.0.3
55
  # via faster-whisper-server (pyproject.toml)
56
- ffmpy==0.3.2
57
  # via gradio
58
  filelock==3.15.4
59
  # via huggingface-hub
@@ -65,9 +53,9 @@ fsspec==2024.6.1
65
  # via
66
  # gradio-client
67
  # huggingface-hub
68
- gradio==4.38.1
69
  # via faster-whisper-server (pyproject.toml)
70
- gradio-client==1.1.0
71
  # via gradio
72
  h11==0.14.0
73
  # via
@@ -75,18 +63,15 @@ h11==0.14.0
75
  # uvicorn
76
  httpcore==1.0.5
77
  # via httpx
78
- httptools==0.6.1
79
- # via uvicorn
80
  httpx==0.27.0
81
  # via
82
  # faster-whisper-server (pyproject.toml)
83
- # fastapi
84
  # gradio
85
  # gradio-client
86
  # openai
87
  httpx-sse==0.4.0
88
  # via faster-whisper-server (pyproject.toml)
89
- huggingface-hub==0.24.0
90
  # via
91
  # faster-whisper-server (pyproject.toml)
92
  # faster-whisper
@@ -95,23 +80,17 @@ huggingface-hub==0.24.0
95
  # tokenizers
96
  humanfriendly==10.0
97
  # via coloredlogs
98
- idna==3.7
99
  # via
100
  # anyio
101
- # email-validator
102
  # httpx
103
  # requests
104
- importlib-resources==6.4.0
105
  # via gradio
106
  jinja2==3.1.4
107
- # via
108
- # altair
109
- # fastapi
110
- # gradio
111
- jsonschema==4.23.0
112
- # via altair
113
- jsonschema-specifications==2023.12.1
114
- # via jsonschema
115
  kiwisolver==1.4.5
116
  # via matplotlib
117
  markdown-it-py==3.0.0
@@ -120,7 +99,7 @@ markupsafe==2.1.5
120
  # via
121
  # gradio
122
  # jinja2
123
- matplotlib==3.9.1
124
  # via gradio
125
  mdurl==0.1.2
126
  # via markdown-it-py
@@ -129,36 +108,32 @@ mpmath==1.3.0
129
  numpy==1.26.4
130
  # via
131
  # faster-whisper-server (pyproject.toml)
132
- # altair
133
  # contourpy
134
  # ctranslate2
135
  # gradio
136
  # matplotlib
137
  # onnxruntime
138
  # pandas
139
- onnxruntime==1.18.1
140
  # via faster-whisper
141
- openai==1.36.0
142
  # via faster-whisper-server (pyproject.toml)
143
- orjson==3.10.6
144
  # via gradio
145
  packaging==24.1
146
  # via
147
- # altair
148
  # gradio
149
  # gradio-client
150
  # huggingface-hub
151
  # matplotlib
152
  # onnxruntime
153
  pandas==2.2.2
154
- # via
155
- # altair
156
- # gradio
157
  pillow==10.4.0
158
  # via
159
  # gradio
160
  # matplotlib
161
- protobuf==5.27.2
162
  # via onnxruntime
163
  pycparser==2.22
164
  # via cffi
@@ -171,52 +146,40 @@ pydantic==2.8.2
171
  # pydantic-settings
172
  pydantic-core==2.20.1
173
  # via pydantic
174
- pydantic-settings==2.3.4
175
  # via faster-whisper-server (pyproject.toml)
176
  pydub==0.25.1
177
  # via gradio
178
  pygments==2.18.0
179
  # via rich
180
- pyparsing==3.1.2
181
  # via matplotlib
182
  python-dateutil==2.9.0.post0
183
  # via
184
  # matplotlib
185
  # pandas
186
  python-dotenv==1.0.1
187
- # via
188
- # pydantic-settings
189
- # uvicorn
190
  python-multipart==0.0.9
191
  # via
192
  # faster-whisper-server (pyproject.toml)
193
- # fastapi
194
  # gradio
195
  pytz==2024.1
196
  # via pandas
197
- pyyaml==6.0.1
198
  # via
199
  # ctranslate2
200
  # gradio
201
  # huggingface-hub
202
- # uvicorn
203
- referencing==0.35.1
204
- # via
205
- # jsonschema
206
- # jsonschema-specifications
207
  requests==2.32.3
208
  # via huggingface-hub
209
- rich==13.7.1
210
  # via typer
211
- rpds-py==0.19.0
212
- # via
213
- # jsonschema
214
- # referencing
215
- ruff==0.5.3
216
  # via gradio
217
  semantic-version==2.10.0
218
  # via gradio
219
- setuptools==71.0.4
220
  # via ctranslate2
221
  shellingham==1.5.4
222
  # via typer
@@ -229,24 +192,20 @@ sniffio==1.3.1
229
  # openai
230
  soundfile==0.12.1
231
  # via faster-whisper-server (pyproject.toml)
232
- starlette==0.37.2
233
  # via fastapi
234
- sympy==1.13.1
235
  # via onnxruntime
236
- tokenizers==0.19.1
237
  # via faster-whisper
238
  tomlkit==0.12.0
239
  # via gradio
240
- toolz==0.12.1
241
- # via altair
242
- tqdm==4.66.4
243
  # via
244
  # huggingface-hub
245
  # openai
246
- typer==0.12.3
247
- # via
248
- # fastapi-cli
249
- # gradio
250
  typing-extensions==4.12.2
251
  # via
252
  # fastapi
@@ -263,16 +222,9 @@ urllib3==2.2.2
263
  # via
264
  # gradio
265
  # requests
266
- uvicorn==0.30.1
267
  # via
268
  # faster-whisper-server (pyproject.toml)
269
- # fastapi
270
  # gradio
271
- uvloop==0.19.0
272
- # via uvicorn
273
- watchfiles==0.22.0
274
- # via uvicorn
275
- websockets==11.0.3
276
- # via
277
- # gradio-client
278
- # uvicorn
 
2
  # uv pip compile --override overrides.txt pyproject.toml
3
  aiofiles==23.2.1
4
  # via gradio
 
 
5
  annotated-types==0.7.0
6
  # via pydantic
7
  anyio==4.4.0
8
  # via
9
+ # gradio
10
  # httpx
11
  # openai
12
  # starlette
13
+ av==12.3.0
 
 
 
 
 
14
  # via faster-whisper
15
  certifi==2024.7.4
16
  # via
17
  # httpcore
18
  # httpx
19
  # requests
20
+ cffi==1.17.0
21
  # via soundfile
22
  charset-normalizer==3.3.2
23
  # via requests
 
35
  # via matplotlib
36
  distro==1.9.0
37
  # via openai
38
+ fastapi==0.112.2
 
 
 
 
39
  # via
40
  # faster-whisper-server (pyproject.toml)
41
  # gradio
 
 
42
  faster-whisper==1.0.3
43
  # via faster-whisper-server (pyproject.toml)
44
+ ffmpy==0.4.0
45
  # via gradio
46
  filelock==3.15.4
47
  # via huggingface-hub
 
53
  # via
54
  # gradio-client
55
  # huggingface-hub
56
+ gradio==4.42.0
57
  # via faster-whisper-server (pyproject.toml)
58
+ gradio-client==1.3.0
59
  # via gradio
60
  h11==0.14.0
61
  # via
 
63
  # uvicorn
64
  httpcore==1.0.5
65
  # via httpx
 
 
66
  httpx==0.27.0
67
  # via
68
  # faster-whisper-server (pyproject.toml)
 
69
  # gradio
70
  # gradio-client
71
  # openai
72
  httpx-sse==0.4.0
73
  # via faster-whisper-server (pyproject.toml)
74
+ huggingface-hub==0.24.6
75
  # via
76
  # faster-whisper-server (pyproject.toml)
77
  # faster-whisper
 
80
  # tokenizers
81
  humanfriendly==10.0
82
  # via coloredlogs
83
+ idna==3.8
84
  # via
85
  # anyio
 
86
  # httpx
87
  # requests
88
+ importlib-resources==6.4.4
89
  # via gradio
90
  jinja2==3.1.4
91
+ # via gradio
92
+ jiter==0.5.0
93
+ # via openai
 
 
 
 
 
94
  kiwisolver==1.4.5
95
  # via matplotlib
96
  markdown-it-py==3.0.0
 
99
  # via
100
  # gradio
101
  # jinja2
102
+ matplotlib==3.9.2
103
  # via gradio
104
  mdurl==0.1.2
105
  # via markdown-it-py
 
108
  numpy==1.26.4
109
  # via
110
  # faster-whisper-server (pyproject.toml)
 
111
  # contourpy
112
  # ctranslate2
113
  # gradio
114
  # matplotlib
115
  # onnxruntime
116
  # pandas
117
+ onnxruntime==1.19.0
118
  # via faster-whisper
119
+ openai==1.42.0
120
  # via faster-whisper-server (pyproject.toml)
121
+ orjson==3.10.7
122
  # via gradio
123
  packaging==24.1
124
  # via
 
125
  # gradio
126
  # gradio-client
127
  # huggingface-hub
128
  # matplotlib
129
  # onnxruntime
130
  pandas==2.2.2
131
+ # via gradio
 
 
132
  pillow==10.4.0
133
  # via
134
  # gradio
135
  # matplotlib
136
+ protobuf==5.27.3
137
  # via onnxruntime
138
  pycparser==2.22
139
  # via cffi
 
146
  # pydantic-settings
147
  pydantic-core==2.20.1
148
  # via pydantic
149
+ pydantic-settings==2.4.0
150
  # via faster-whisper-server (pyproject.toml)
151
  pydub==0.25.1
152
  # via gradio
153
  pygments==2.18.0
154
  # via rich
155
+ pyparsing==3.1.4
156
  # via matplotlib
157
  python-dateutil==2.9.0.post0
158
  # via
159
  # matplotlib
160
  # pandas
161
  python-dotenv==1.0.1
162
+ # via pydantic-settings
 
 
163
  python-multipart==0.0.9
164
  # via
165
  # faster-whisper-server (pyproject.toml)
 
166
  # gradio
167
  pytz==2024.1
168
  # via pandas
169
+ pyyaml==6.0.2
170
  # via
171
  # ctranslate2
172
  # gradio
173
  # huggingface-hub
 
 
 
 
 
174
  requests==2.32.3
175
  # via huggingface-hub
176
+ rich==13.8.0
177
  # via typer
178
+ ruff==0.6.2
 
 
 
 
179
  # via gradio
180
  semantic-version==2.10.0
181
  # via gradio
182
+ setuptools==73.0.1
183
  # via ctranslate2
184
  shellingham==1.5.4
185
  # via typer
 
192
  # openai
193
  soundfile==0.12.1
194
  # via faster-whisper-server (pyproject.toml)
195
+ starlette==0.38.2
196
  # via fastapi
197
+ sympy==1.13.2
198
  # via onnxruntime
199
+ tokenizers==0.20.0
200
  # via faster-whisper
201
  tomlkit==0.12.0
202
  # via gradio
203
+ tqdm==4.66.5
 
 
204
  # via
205
  # huggingface-hub
206
  # openai
207
+ typer==0.12.5
208
+ # via gradio
 
 
209
  typing-extensions==4.12.2
210
  # via
211
  # fastapi
 
222
  # via
223
  # gradio
224
  # requests
225
+ uvicorn==0.30.6
226
  # via
227
  # faster-whisper-server (pyproject.toml)
 
228
  # gradio
229
+ websockets==12.0
230
+ # via gradio-client
 
 
 
 
 
 
scripts/client.py ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ from pathlib import Path
3
+ import subprocess
4
+ import threading
5
+
6
+ import httpx
7
+ import keyboard
8
+
9
+ # NOTE: this is a very basic implementation. Not really meant for usage by others.
10
+ # Included here in case someone wants to use it as a reference.
11
+
12
+ # This script will run in the background and listen for a keybind to start recording audio.
13
+ # It will then wait until the keybind is pressed again to stop recording.
14
+ # The audio file will be sent to the server for transcription.
15
+ # The transcription will be copied to the clipboard.
16
+ # When having a short audio of a couple of sentences and running inference on a GPU the response time is very fast (less than 2 seconds). # noqa: E501
17
+
18
+ CHUNK = 2**12
19
+ AUDIO_RECORD_CMD = [
20
+ "ffmpeg",
21
+ # "-hide_banner",
22
+ # "-loglevel",
23
+ # "quiet",
24
+ "-f",
25
+ "alsa",
26
+ "-i",
27
+ "default",
28
+ "-f",
29
+ "wav",
30
+ # "-ac",
31
+ # "1",
32
+ # "-ar",
33
+ # "16000",
34
+ # "-f",
35
+ # "s16le",
36
+ # "-acodec",
37
+ # "pcm_s16le",
38
+ # "-",
39
+ ]
40
+ COPY_TO_CLIPBOARD_CMD = "wl-copy"
41
+ OPENAI_BASE_URL = "ws://localhost:8000/v1"
42
+ TRANSCRIBE_PATH = "/audio/transcriptions?language=en"
43
+ USER = "nixos"
44
+ TIMEOUT = httpx.Timeout(None)
45
+ KEYBIND = "ctrl+x"
46
+ LANGUAGE = "en"
47
+ RESPONSE_FORMAT = "text"
48
+
49
+ client = httpx.Client(base_url=OPENAI_BASE_URL, timeout=TIMEOUT)
50
+ is_running = threading.Event()
51
+ file = Path("test.wav") # TODO: use tempfile
52
+
53
+
54
+ while True:
55
+ keyboard.wait(KEYBIND)
56
+ print("Action started")
57
+ process = subprocess.Popen(
58
+ [*AUDIO_RECORD_CMD, "-y", str(file.name)],
59
+ stdout=subprocess.PIPE,
60
+ stderr=subprocess.PIPE,
61
+ user=USER,
62
+ env=dict(os.environ),
63
+ )
64
+ keyboard.wait(KEYBIND)
65
+ process.kill()
66
+ print("Action finished")
67
+
68
+ with open(file, "rb") as f:
69
+ res = client.post(
70
+ OPENAI_BASE_URL + TRANSCRIBE_PATH,
71
+ files={"file": f},
72
+ data={
73
+ "response_format": RESPONSE_FORMAT,
74
+ "language": LANGUAGE,
75
+ },
76
+ )
77
+ transcription = res.text
78
+ print(transcription)
79
+ subprocess.run([COPY_TO_CLIPBOARD_CMD], input=transcription.encode(), check=True)