kaubarros-24 commited on
Commit
33cc5aa
·
1 Parent(s): ea4407b

Changed AI for gradio

Browse files
Files changed (3) hide show
  1. pdm.lock +366 -14
  2. pyproject.toml +1 -1
  3. src/ai/main.py +30 -2
pdm.lock CHANGED
@@ -5,7 +5,7 @@
5
  groups = ["default"]
6
  strategy = ["inherit_metadata"]
7
  lock_version = "4.5.0"
8
- content_hash = "sha256:a51681a51fae946fb9e6304537c17beef8bb7a22a0cb4c005c17f70cb0ed5865"
9
 
10
  [[metadata.targets]]
11
  requires_python = "==3.11.*"
@@ -21,6 +21,17 @@ files = [
21
  {file = "absl_py-2.1.0-py3-none-any.whl", hash = "sha256:526a04eadab8b4ee719ce68f204172ead1027549089702d99b9059f129ff1308"},
22
  ]
23
 
 
 
 
 
 
 
 
 
 
 
 
24
  [[package]]
25
  name = "annotated-types"
26
  version = "0.7.0"
@@ -146,6 +157,17 @@ files = [
146
  {file = "fastapi-0.115.4.tar.gz", hash = "sha256:db653475586b091cb8b2fec2ac54a680ac6a158e07406e1abae31679e8826349"},
147
  ]
148
 
 
 
 
 
 
 
 
 
 
 
 
149
  [[package]]
150
  name = "filelock"
151
  version = "3.16.1"
@@ -202,6 +224,65 @@ files = [
202
  {file = "google_pasta-0.2.0-py3-none-any.whl", hash = "sha256:b32482794a366b5366a32c92a9a9201b107821889935a02b3e51f6b432ea84ed"},
203
  ]
204
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
205
  [[package]]
206
  name = "grpcio"
207
  version = "1.67.1"
@@ -253,6 +334,39 @@ files = [
253
  {file = "h5py-3.12.1.tar.gz", hash = "sha256:326d70b53d31baa61f00b8aa5f95c2fcb9621a3ee8365d770c551a13dbbcbfdf"},
254
  ]
255
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  [[package]]
257
  name = "huggingface"
258
  version = "0.0.1"
@@ -377,22 +491,22 @@ files = [
377
 
378
  [[package]]
379
  name = "markupsafe"
380
- version = "3.0.2"
381
- requires_python = ">=3.9"
382
  summary = "Safely add untrusted strings to HTML/XML markup."
383
  groups = ["default"]
384
  files = [
385
- {file = "MarkupSafe-3.0.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9025b4018f3a1314059769c7bf15441064b2207cb3f065e6ea1e7359cb46db9d"},
386
- {file = "MarkupSafe-3.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:93335ca3812df2f366e80509ae119189886b0f3c2b81325d39efdb84a1e2ae93"},
387
- {file = "MarkupSafe-3.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2cb8438c3cbb25e220c2ab33bb226559e7afb3baec11c4f218ffa7308603c832"},
388
- {file = "MarkupSafe-3.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a123e330ef0853c6e822384873bef7507557d8e4a082961e1defa947aa59ba84"},
389
- {file = "MarkupSafe-3.0.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1e084f686b92e5b83186b07e8a17fc09e38fff551f3602b249881fec658d3eca"},
390
- {file = "MarkupSafe-3.0.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d8213e09c917a951de9d09ecee036d5c7d36cb6cb7dbaece4c71a60d79fb9798"},
391
- {file = "MarkupSafe-3.0.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:5b02fb34468b6aaa40dfc198d813a641e3a63b98c2b05a16b9f80b7ec314185e"},
392
- {file = "MarkupSafe-3.0.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:0bff5e0ae4ef2e1ae4fdf2dfd5b76c75e5c2fa4132d05fc1b0dabcd20c7e28c4"},
393
- {file = "MarkupSafe-3.0.2-cp311-cp311-win32.whl", hash = "sha256:6c89876f41da747c8d3677a2b540fb32ef5715f97b66eeb0c6b66f5e3ef6f59d"},
394
- {file = "MarkupSafe-3.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:70a87b411535ccad5ef2f1df5136506a10775d267e197e4cf531ced10537bd6b"},
395
- {file = "markupsafe-3.0.2.tar.gz", hash = "sha256:ee55d3edf80167e48ea11a923c7386f4669df67d7994554387f84e7d8b0a2bf0"},
396
  ]
397
 
398
  [[package]]
@@ -679,6 +793,26 @@ files = [
679
  {file = "optree-0.13.0.tar.gz", hash = "sha256:1ea493cde8c60f7950ccbd682bd67e787bf67ed2251d6d3e9ad7471b72d37538"},
680
  ]
681
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
682
  [[package]]
683
  name = "packaging"
684
  version = "24.2"
@@ -690,6 +824,52 @@ files = [
690
  {file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"},
691
  ]
692
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
693
  [[package]]
694
  name = "protobuf"
695
  version = "5.28.3"
@@ -748,6 +928,16 @@ files = [
748
  {file = "pydantic_core-2.23.4.tar.gz", hash = "sha256:2584f7cf844ac4d970fba483a717dbe10c1c1c96a969bf65d61ffe94df1b2863"},
749
  ]
750
 
 
 
 
 
 
 
 
 
 
 
751
  [[package]]
752
  name = "pygments"
753
  version = "2.18.0"
@@ -759,6 +949,41 @@ files = [
759
  {file = "pygments-2.18.0.tar.gz", hash = "sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199"},
760
  ]
761
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
762
  [[package]]
763
  name = "pyyaml"
764
  version = "6.0.2"
@@ -836,6 +1061,48 @@ files = [
836
  {file = "rich-13.9.4.tar.gz", hash = "sha256:439594978a49a09530cff7ebc4b5c7103ef57baf48d5ea3184f21d9a2befa098"},
837
  ]
838
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
839
  [[package]]
840
  name = "safetensors"
841
  version = "0.4.5"
@@ -858,6 +1125,17 @@ files = [
858
  {file = "safetensors-0.4.5.tar.gz", hash = "sha256:d73de19682deabb02524b3d5d1f8b3aaba94c72f1bbfc7911b9b9d5d391c0310"},
859
  ]
860
 
 
 
 
 
 
 
 
 
 
 
 
861
  [[package]]
862
  name = "setuptools"
863
  version = "75.3.0"
@@ -869,6 +1147,18 @@ files = [
869
  {file = "setuptools-75.3.0.tar.gz", hash = "sha256:fba5dd4d766e97be1b1681d98712680ae8f2f26d7881245f2ce9e40714f1a686"},
870
  ]
871
 
 
 
 
 
 
 
 
 
 
 
 
 
872
  [[package]]
873
  name = "six"
874
  version = "1.16.0"
@@ -1056,6 +1346,17 @@ files = [
1056
  {file = "tokenizers-0.20.3.tar.gz", hash = "sha256:2278b34c5d0dd78e087e1ca7f9b1dcbf129d80211afa645f214bd6e051037539"},
1057
  ]
1058
 
 
 
 
 
 
 
 
 
 
 
 
1059
  [[package]]
1060
  name = "torch"
1061
  version = "2.5.1"
@@ -1142,6 +1443,24 @@ files = [
1142
  {file = "triton-3.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0f34f6e7885d1bf0eaaf7ba875a5f0ce6f3c13ba98f9503651c1e6dc6757ed5c"},
1143
  ]
1144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1145
  [[package]]
1146
  name = "typing-extensions"
1147
  version = "4.12.2"
@@ -1153,6 +1472,17 @@ files = [
1153
  {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"},
1154
  ]
1155
 
 
 
 
 
 
 
 
 
 
 
 
1156
  [[package]]
1157
  name = "urllib3"
1158
  version = "2.2.3"
@@ -1180,6 +1510,28 @@ files = [
1180
  {file = "uvicorn-0.32.0.tar.gz", hash = "sha256:f78b36b143c16f54ccdb8190d0a26b5f1901fe5a3c777e1ab29f26391af8551e"},
1181
  ]
1182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1183
  [[package]]
1184
  name = "werkzeug"
1185
  version = "3.1.3"
 
5
  groups = ["default"]
6
  strategy = ["inherit_metadata"]
7
  lock_version = "4.5.0"
8
+ content_hash = "sha256:7e792144d535ff2bc07dc0a5fa0184e7831e0038c7882f92c00ee6eb3d1a347f"
9
 
10
  [[metadata.targets]]
11
  requires_python = "==3.11.*"
 
21
  {file = "absl_py-2.1.0-py3-none-any.whl", hash = "sha256:526a04eadab8b4ee719ce68f204172ead1027549089702d99b9059f129ff1308"},
22
  ]
23
 
24
+ [[package]]
25
+ name = "aiofiles"
26
+ version = "23.2.1"
27
+ requires_python = ">=3.7"
28
+ summary = "File support for asyncio."
29
+ groups = ["default"]
30
+ files = [
31
+ {file = "aiofiles-23.2.1-py3-none-any.whl", hash = "sha256:19297512c647d4b27a2cf7c34caa7e405c0d60b5560618a29a9fe027b18b0107"},
32
+ {file = "aiofiles-23.2.1.tar.gz", hash = "sha256:84ec2218d8419404abcb9f0c02df3f34c6e0a68ed41072acfb1cef5cbc29051a"},
33
+ ]
34
+
35
  [[package]]
36
  name = "annotated-types"
37
  version = "0.7.0"
 
157
  {file = "fastapi-0.115.4.tar.gz", hash = "sha256:db653475586b091cb8b2fec2ac54a680ac6a158e07406e1abae31679e8826349"},
158
  ]
159
 
160
+ [[package]]
161
+ name = "ffmpy"
162
+ version = "0.4.0"
163
+ requires_python = "<4.0.0,>=3.8.1"
164
+ summary = "A simple Python wrapper for FFmpeg"
165
+ groups = ["default"]
166
+ files = [
167
+ {file = "ffmpy-0.4.0-py3-none-any.whl", hash = "sha256:39c0f20c5b465e7f8d29a5191f3a7d7675a8c546d9d985de8921151cd9b59e14"},
168
+ {file = "ffmpy-0.4.0.tar.gz", hash = "sha256:131b57794e802ad555f579007497f7a3d0cab0583d37496c685b8acae4837b1d"},
169
+ ]
170
+
171
  [[package]]
172
  name = "filelock"
173
  version = "3.16.1"
 
224
  {file = "google_pasta-0.2.0-py3-none-any.whl", hash = "sha256:b32482794a366b5366a32c92a9a9201b107821889935a02b3e51f6b432ea84ed"},
225
  ]
226
 
227
+ [[package]]
228
+ name = "gradio"
229
+ version = "5.5.0"
230
+ requires_python = ">=3.10"
231
+ summary = "Python library for easily interacting with trained machine learning models"
232
+ groups = ["default"]
233
+ dependencies = [
234
+ "aiofiles<24.0,>=22.0",
235
+ "anyio<5.0,>=3.0",
236
+ "audioop-lts<1.0; python_version >= \"3.13\"",
237
+ "fastapi<1.0,>=0.115.2",
238
+ "ffmpy",
239
+ "gradio-client==1.4.2",
240
+ "httpx>=0.24.1",
241
+ "huggingface-hub>=0.25.1",
242
+ "jinja2<4.0",
243
+ "markupsafe~=2.0",
244
+ "numpy<3.0,>=1.0",
245
+ "orjson~=3.0",
246
+ "packaging",
247
+ "pandas<3.0,>=1.0",
248
+ "pillow<12.0,>=8.0",
249
+ "pydantic>=2.0",
250
+ "pydub",
251
+ "python-multipart==0.0.12",
252
+ "pyyaml<7.0,>=5.0",
253
+ "ruff>=0.2.2; sys_platform != \"emscripten\"",
254
+ "safehttpx<1.0,>=0.1.1",
255
+ "semantic-version~=2.0",
256
+ "starlette<1.0,>=0.40.0; sys_platform != \"emscripten\"",
257
+ "tomlkit==0.12.0",
258
+ "typer<1.0,>=0.12; sys_platform != \"emscripten\"",
259
+ "typing-extensions~=4.0",
260
+ "urllib3~=2.0; sys_platform == \"emscripten\"",
261
+ "uvicorn>=0.14.0; sys_platform != \"emscripten\"",
262
+ ]
263
+ files = [
264
+ {file = "gradio-5.5.0-py3-none-any.whl", hash = "sha256:48ea11ae1376d9506eb295dbeb4d3ff962830a6e2d8aa9085e025cce3c04e544"},
265
+ ]
266
+
267
+ [[package]]
268
+ name = "gradio-client"
269
+ version = "1.4.2"
270
+ requires_python = ">=3.10"
271
+ summary = "Python library for easily interacting with trained machine learning models"
272
+ groups = ["default"]
273
+ dependencies = [
274
+ "fsspec",
275
+ "httpx>=0.24.1",
276
+ "huggingface-hub>=0.19.3",
277
+ "packaging",
278
+ "typing-extensions~=4.0",
279
+ "websockets<13.0,>=10.0",
280
+ ]
281
+ files = [
282
+ {file = "gradio_client-1.4.2-py3-none-any.whl", hash = "sha256:76a34996b4580939a3fbd10144fde04eced586c033b6cdcb315d69b1459136d1"},
283
+ {file = "gradio_client-1.4.2.tar.gz", hash = "sha256:07c5184ad6385f50f9e6eae3a262ad6afcf9380b6a400d070652f76e14222dbd"},
284
+ ]
285
+
286
  [[package]]
287
  name = "grpcio"
288
  version = "1.67.1"
 
334
  {file = "h5py-3.12.1.tar.gz", hash = "sha256:326d70b53d31baa61f00b8aa5f95c2fcb9621a3ee8365d770c551a13dbbcbfdf"},
335
  ]
336
 
337
+ [[package]]
338
+ name = "httpcore"
339
+ version = "1.0.6"
340
+ requires_python = ">=3.8"
341
+ summary = "A minimal low-level HTTP client."
342
+ groups = ["default"]
343
+ dependencies = [
344
+ "certifi",
345
+ "h11<0.15,>=0.13",
346
+ ]
347
+ files = [
348
+ {file = "httpcore-1.0.6-py3-none-any.whl", hash = "sha256:27b59625743b85577a8c0e10e55b50b5368a4f2cfe8cc7bcfa9cf00829c2682f"},
349
+ {file = "httpcore-1.0.6.tar.gz", hash = "sha256:73f6dbd6eb8c21bbf7ef8efad555481853f5f6acdeaff1edb0694289269ee17f"},
350
+ ]
351
+
352
+ [[package]]
353
+ name = "httpx"
354
+ version = "0.27.2"
355
+ requires_python = ">=3.8"
356
+ summary = "The next generation HTTP client."
357
+ groups = ["default"]
358
+ dependencies = [
359
+ "anyio",
360
+ "certifi",
361
+ "httpcore==1.*",
362
+ "idna",
363
+ "sniffio",
364
+ ]
365
+ files = [
366
+ {file = "httpx-0.27.2-py3-none-any.whl", hash = "sha256:7bb2708e112d8fdd7829cd4243970f0c223274051cb35ee80c03301ee29a3df0"},
367
+ {file = "httpx-0.27.2.tar.gz", hash = "sha256:f7c2be1d2f3c3c3160d441802406b206c2b76f5947b11115e6df10c6c65e66c2"},
368
+ ]
369
+
370
  [[package]]
371
  name = "huggingface"
372
  version = "0.0.1"
 
491
 
492
  [[package]]
493
  name = "markupsafe"
494
+ version = "2.1.5"
495
+ requires_python = ">=3.7"
496
  summary = "Safely add untrusted strings to HTML/XML markup."
497
  groups = ["default"]
498
  files = [
499
+ {file = "MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:629ddd2ca402ae6dbedfceeba9c46d5f7b2a61d9749597d4307f943ef198fc1f"},
500
+ {file = "MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5b7b716f97b52c5a14bffdf688f971b2d5ef4029127f1ad7a513973cfd818df2"},
501
+ {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6ec585f69cec0aa07d945b20805be741395e28ac1627333b1c5b0105962ffced"},
502
+ {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b91c037585eba9095565a3556f611e3cbfaa42ca1e865f7b8015fe5c7336d5a5"},
503
+ {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7502934a33b54030eaf1194c21c692a534196063db72176b0c4028e140f8f32c"},
504
+ {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0e397ac966fdf721b2c528cf028494e86172b4feba51d65f81ffd65c63798f3f"},
505
+ {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:c061bb86a71b42465156a3ee7bd58c8c2ceacdbeb95d05a99893e08b8467359a"},
506
+ {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3a57fdd7ce31c7ff06cdfbf31dafa96cc533c21e443d57f5b1ecc6cdc668ec7f"},
507
+ {file = "MarkupSafe-2.1.5-cp311-cp311-win32.whl", hash = "sha256:397081c1a0bfb5124355710fe79478cdbeb39626492b15d399526ae53422b906"},
508
+ {file = "MarkupSafe-2.1.5-cp311-cp311-win_amd64.whl", hash = "sha256:2b7c57a4dfc4f16f7142221afe5ba4e093e09e728ca65c51f5620c9aaeb9a617"},
509
+ {file = "MarkupSafe-2.1.5.tar.gz", hash = "sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b"},
510
  ]
511
 
512
  [[package]]
 
793
  {file = "optree-0.13.0.tar.gz", hash = "sha256:1ea493cde8c60f7950ccbd682bd67e787bf67ed2251d6d3e9ad7471b72d37538"},
794
  ]
795
 
796
+ [[package]]
797
+ name = "orjson"
798
+ version = "3.10.11"
799
+ requires_python = ">=3.8"
800
+ summary = "Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy"
801
+ groups = ["default"]
802
+ files = [
803
+ {file = "orjson-3.10.11-cp311-cp311-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:1444f9cb7c14055d595de1036f74ecd6ce15f04a715e73f33bb6326c9cef01b6"},
804
+ {file = "orjson-3.10.11-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cdec57fe3b4bdebcc08a946db3365630332dbe575125ff3d80a3272ebd0ddafe"},
805
+ {file = "orjson-3.10.11-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4eed32f33a0ea6ef36ccc1d37f8d17f28a1d6e8eefae5928f76aff8f1df85e67"},
806
+ {file = "orjson-3.10.11-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:80df27dd8697242b904f4ea54820e2d98d3f51f91e97e358fc13359721233e4b"},
807
+ {file = "orjson-3.10.11-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:705f03cee0cb797256d54de6695ef219e5bc8c8120b6654dd460848d57a9af3d"},
808
+ {file = "orjson-3.10.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:03246774131701de8e7059b2e382597da43144a9a7400f178b2a32feafc54bd5"},
809
+ {file = "orjson-3.10.11-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8b5759063a6c940a69c728ea70d7c33583991c6982915a839c8da5f957e0103a"},
810
+ {file = "orjson-3.10.11-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:677f23e32491520eebb19c99bb34675daf5410c449c13416f7f0d93e2cf5f981"},
811
+ {file = "orjson-3.10.11-cp311-none-win32.whl", hash = "sha256:a11225d7b30468dcb099498296ffac36b4673a8398ca30fdaec1e6c20df6aa55"},
812
+ {file = "orjson-3.10.11-cp311-none-win_amd64.whl", hash = "sha256:df8c677df2f9f385fcc85ab859704045fa88d4668bc9991a527c86e710392bec"},
813
+ {file = "orjson-3.10.11.tar.gz", hash = "sha256:e35b6d730de6384d5b2dab5fd23f0d76fae8bbc8c353c2f78210aa5fa4beb3ef"},
814
+ ]
815
+
816
  [[package]]
817
  name = "packaging"
818
  version = "24.2"
 
824
  {file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"},
825
  ]
826
 
827
+ [[package]]
828
+ name = "pandas"
829
+ version = "2.2.3"
830
+ requires_python = ">=3.9"
831
+ summary = "Powerful data structures for data analysis, time series, and statistics"
832
+ groups = ["default"]
833
+ dependencies = [
834
+ "numpy>=1.22.4; python_version < \"3.11\"",
835
+ "numpy>=1.23.2; python_version == \"3.11\"",
836
+ "numpy>=1.26.0; python_version >= \"3.12\"",
837
+ "python-dateutil>=2.8.2",
838
+ "pytz>=2020.1",
839
+ "tzdata>=2022.7",
840
+ ]
841
+ files = [
842
+ {file = "pandas-2.2.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:66108071e1b935240e74525006034333f98bcdb87ea116de573a6a0dccb6c039"},
843
+ {file = "pandas-2.2.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7c2875855b0ff77b2a64a0365e24455d9990730d6431b9e0ee18ad8acee13dbd"},
844
+ {file = "pandas-2.2.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:cd8d0c3be0515c12fed0bdbae072551c8b54b7192c7b1fda0ba56059a0179698"},
845
+ {file = "pandas-2.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c124333816c3a9b03fbeef3a9f230ba9a737e9e5bb4060aa2107a86cc0a497fc"},
846
+ {file = "pandas-2.2.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:63cc132e40a2e084cf01adf0775b15ac515ba905d7dcca47e9a251819c575ef3"},
847
+ {file = "pandas-2.2.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:29401dbfa9ad77319367d36940cd8a0b3a11aba16063e39632d98b0e931ddf32"},
848
+ {file = "pandas-2.2.3-cp311-cp311-win_amd64.whl", hash = "sha256:3fc6873a41186404dad67245896a6e440baacc92f5b716ccd1bc9ed2995ab2c5"},
849
+ {file = "pandas-2.2.3.tar.gz", hash = "sha256:4f18ba62b61d7e192368b84517265a99b4d7ee8912f8708660fb4a366cc82667"},
850
+ ]
851
+
852
+ [[package]]
853
+ name = "pillow"
854
+ version = "11.0.0"
855
+ requires_python = ">=3.9"
856
+ summary = "Python Imaging Library (Fork)"
857
+ groups = ["default"]
858
+ files = [
859
+ {file = "pillow-11.0.0-cp311-cp311-macosx_10_10_x86_64.whl", hash = "sha256:1c1d72714f429a521d8d2d018badc42414c3077eb187a59579f28e4270b4b0fc"},
860
+ {file = "pillow-11.0.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:499c3a1b0d6fc8213519e193796eb1a86a1be4b1877d678b30f83fd979811d1a"},
861
+ {file = "pillow-11.0.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c8b2351c85d855293a299038e1f89db92a2f35e8d2f783489c6f0b2b5f3fe8a3"},
862
+ {file = "pillow-11.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f4dba50cfa56f910241eb7f883c20f1e7b1d8f7d91c750cd0b318bad443f4d5"},
863
+ {file = "pillow-11.0.0-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:5ddbfd761ee00c12ee1be86c9c0683ecf5bb14c9772ddbd782085779a63dd55b"},
864
+ {file = "pillow-11.0.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:45c566eb10b8967d71bf1ab8e4a525e5a93519e29ea071459ce517f6b903d7fa"},
865
+ {file = "pillow-11.0.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:b4fd7bd29610a83a8c9b564d457cf5bd92b4e11e79a4ee4716a63c959699b306"},
866
+ {file = "pillow-11.0.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:cb929ca942d0ec4fac404cbf520ee6cac37bf35be479b970c4ffadf2b6a1cad9"},
867
+ {file = "pillow-11.0.0-cp311-cp311-win32.whl", hash = "sha256:006bcdd307cc47ba43e924099a038cbf9591062e6c50e570819743f5607404f5"},
868
+ {file = "pillow-11.0.0-cp311-cp311-win_amd64.whl", hash = "sha256:52a2d8323a465f84faaba5236567d212c3668f2ab53e1c74c15583cf507a0291"},
869
+ {file = "pillow-11.0.0-cp311-cp311-win_arm64.whl", hash = "sha256:16095692a253047fe3ec028e951fa4221a1f3ed3d80c397e83541a3037ff67c9"},
870
+ {file = "pillow-11.0.0.tar.gz", hash = "sha256:72bacbaf24ac003fea9bff9837d1eedb6088758d41e100c1552930151f677739"},
871
+ ]
872
+
873
  [[package]]
874
  name = "protobuf"
875
  version = "5.28.3"
 
928
  {file = "pydantic_core-2.23.4.tar.gz", hash = "sha256:2584f7cf844ac4d970fba483a717dbe10c1c1c96a969bf65d61ffe94df1b2863"},
929
  ]
930
 
931
+ [[package]]
932
+ name = "pydub"
933
+ version = "0.25.1"
934
+ summary = "Manipulate audio with an simple and easy high level interface"
935
+ groups = ["default"]
936
+ files = [
937
+ {file = "pydub-0.25.1-py2.py3-none-any.whl", hash = "sha256:65617e33033874b59d87db603aa1ed450633288aefead953b30bded59cb599a6"},
938
+ {file = "pydub-0.25.1.tar.gz", hash = "sha256:980a33ce9949cab2a569606b65674d748ecbca4f0796887fd6f46173a7b0d30f"},
939
+ ]
940
+
941
  [[package]]
942
  name = "pygments"
943
  version = "2.18.0"
 
949
  {file = "pygments-2.18.0.tar.gz", hash = "sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199"},
950
  ]
951
 
952
+ [[package]]
953
+ name = "python-dateutil"
954
+ version = "2.9.0.post0"
955
+ requires_python = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7"
956
+ summary = "Extensions to the standard Python datetime module"
957
+ groups = ["default"]
958
+ dependencies = [
959
+ "six>=1.5",
960
+ ]
961
+ files = [
962
+ {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"},
963
+ {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"},
964
+ ]
965
+
966
+ [[package]]
967
+ name = "python-multipart"
968
+ version = "0.0.12"
969
+ requires_python = ">=3.8"
970
+ summary = "A streaming multipart parser for Python"
971
+ groups = ["default"]
972
+ files = [
973
+ {file = "python_multipart-0.0.12-py3-none-any.whl", hash = "sha256:43dcf96cf65888a9cd3423544dd0d75ac10f7aa0c3c28a175bbcd00c9ce1aebf"},
974
+ {file = "python_multipart-0.0.12.tar.gz", hash = "sha256:045e1f98d719c1ce085ed7f7e1ef9d8ccc8c02ba02b5566d5f7521410ced58cb"},
975
+ ]
976
+
977
+ [[package]]
978
+ name = "pytz"
979
+ version = "2024.2"
980
+ summary = "World timezone definitions, modern and historical"
981
+ groups = ["default"]
982
+ files = [
983
+ {file = "pytz-2024.2-py2.py3-none-any.whl", hash = "sha256:31c7c1817eb7fae7ca4b8c7ee50c72f93aa2dd863de768e1ef4245d426aa0725"},
984
+ {file = "pytz-2024.2.tar.gz", hash = "sha256:2aa355083c50a0f93fa581709deac0c9ad65cca8a9e9beac660adcbd493c798a"},
985
+ ]
986
+
987
  [[package]]
988
  name = "pyyaml"
989
  version = "6.0.2"
 
1061
  {file = "rich-13.9.4.tar.gz", hash = "sha256:439594978a49a09530cff7ebc4b5c7103ef57baf48d5ea3184f21d9a2befa098"},
1062
  ]
1063
 
1064
+ [[package]]
1065
+ name = "ruff"
1066
+ version = "0.7.3"
1067
+ requires_python = ">=3.7"
1068
+ summary = "An extremely fast Python linter and code formatter, written in Rust."
1069
+ groups = ["default"]
1070
+ marker = "sys_platform != \"emscripten\""
1071
+ files = [
1072
+ {file = "ruff-0.7.3-py3-none-linux_armv6l.whl", hash = "sha256:34f2339dc22687ec7e7002792d1f50712bf84a13d5152e75712ac08be565d344"},
1073
+ {file = "ruff-0.7.3-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:fb397332a1879b9764a3455a0bb1087bda876c2db8aca3a3cbb67b3dbce8cda0"},
1074
+ {file = "ruff-0.7.3-py3-none-macosx_11_0_arm64.whl", hash = "sha256:37d0b619546103274e7f62643d14e1adcbccb242efda4e4bdb9544d7764782e9"},
1075
+ {file = "ruff-0.7.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d59f0c3ee4d1a6787614e7135b72e21024875266101142a09a61439cb6e38a5"},
1076
+ {file = "ruff-0.7.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:44eb93c2499a169d49fafd07bc62ac89b1bc800b197e50ff4633aed212569299"},
1077
+ {file = "ruff-0.7.3-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6d0242ce53f3a576c35ee32d907475a8d569944c0407f91d207c8af5be5dae4e"},
1078
+ {file = "ruff-0.7.3-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:6b6224af8b5e09772c2ecb8dc9f3f344c1aa48201c7f07e7315367f6dd90ac29"},
1079
+ {file = "ruff-0.7.3-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c50f95a82b94421c964fae4c27c0242890a20fe67d203d127e84fbb8013855f5"},
1080
+ {file = "ruff-0.7.3-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7f3eff9961b5d2644bcf1616c606e93baa2d6b349e8aa8b035f654df252c8c67"},
1081
+ {file = "ruff-0.7.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b8963cab06d130c4df2fd52c84e9f10d297826d2e8169ae0c798b6221be1d1d2"},
1082
+ {file = "ruff-0.7.3-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:61b46049d6edc0e4317fb14b33bd693245281a3007288b68a3f5b74a22a0746d"},
1083
+ {file = "ruff-0.7.3-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:10ebce7696afe4644e8c1a23b3cf8c0f2193a310c18387c06e583ae9ef284de2"},
1084
+ {file = "ruff-0.7.3-py3-none-musllinux_1_2_i686.whl", hash = "sha256:3f36d56326b3aef8eeee150b700e519880d1aab92f471eefdef656fd57492aa2"},
1085
+ {file = "ruff-0.7.3-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:5d024301109a0007b78d57ab0ba190087b43dce852e552734ebf0b0b85e4fb16"},
1086
+ {file = "ruff-0.7.3-py3-none-win32.whl", hash = "sha256:4ba81a5f0c5478aa61674c5a2194de8b02652f17addf8dfc40c8937e6e7d79fc"},
1087
+ {file = "ruff-0.7.3-py3-none-win_amd64.whl", hash = "sha256:588a9ff2fecf01025ed065fe28809cd5a53b43505f48b69a1ac7707b1b7e4088"},
1088
+ {file = "ruff-0.7.3-py3-none-win_arm64.whl", hash = "sha256:1713e2c5545863cdbfe2cbce21f69ffaf37b813bfd1fb3b90dc9a6f1963f5a8c"},
1089
+ {file = "ruff-0.7.3.tar.gz", hash = "sha256:e1d1ba2e40b6e71a61b063354d04be669ab0d39c352461f3d789cac68b54a313"},
1090
+ ]
1091
+
1092
+ [[package]]
1093
+ name = "safehttpx"
1094
+ version = "0.1.1"
1095
+ requires_python = ">=3.9"
1096
+ summary = "A small Python library created to help developers protect their applications from Server Side Request Forgery (SSRF) attacks."
1097
+ groups = ["default"]
1098
+ dependencies = [
1099
+ "httpx",
1100
+ ]
1101
+ files = [
1102
+ {file = "safehttpx-0.1.1-py3-none-any.whl", hash = "sha256:1d93b64023c00d5c53ea70ea36e773b8a0dba5eaf1a1eb188856584a0a4cf4d1"},
1103
+ {file = "safehttpx-0.1.1.tar.gz", hash = "sha256:6e1bedf7767213300da5e4cb7e823e98edc934f17ca192d2e585111a2b899149"},
1104
+ ]
1105
+
1106
  [[package]]
1107
  name = "safetensors"
1108
  version = "0.4.5"
 
1125
  {file = "safetensors-0.4.5.tar.gz", hash = "sha256:d73de19682deabb02524b3d5d1f8b3aaba94c72f1bbfc7911b9b9d5d391c0310"},
1126
  ]
1127
 
1128
+ [[package]]
1129
+ name = "semantic-version"
1130
+ version = "2.10.0"
1131
+ requires_python = ">=2.7"
1132
+ summary = "A library implementing the 'SemVer' scheme."
1133
+ groups = ["default"]
1134
+ files = [
1135
+ {file = "semantic_version-2.10.0-py2.py3-none-any.whl", hash = "sha256:de78a3b8e0feda74cabc54aab2da702113e33ac9d9eb9d2389bcf1f58b7d9177"},
1136
+ {file = "semantic_version-2.10.0.tar.gz", hash = "sha256:bdabb6d336998cbb378d4b9db3a4b56a1e3235701dc05ea2690d9a997ed5041c"},
1137
+ ]
1138
+
1139
  [[package]]
1140
  name = "setuptools"
1141
  version = "75.3.0"
 
1147
  {file = "setuptools-75.3.0.tar.gz", hash = "sha256:fba5dd4d766e97be1b1681d98712680ae8f2f26d7881245f2ce9e40714f1a686"},
1148
  ]
1149
 
1150
+ [[package]]
1151
+ name = "shellingham"
1152
+ version = "1.5.4"
1153
+ requires_python = ">=3.7"
1154
+ summary = "Tool to Detect Surrounding Shell"
1155
+ groups = ["default"]
1156
+ marker = "sys_platform != \"emscripten\""
1157
+ files = [
1158
+ {file = "shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686"},
1159
+ {file = "shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de"},
1160
+ ]
1161
+
1162
  [[package]]
1163
  name = "six"
1164
  version = "1.16.0"
 
1346
  {file = "tokenizers-0.20.3.tar.gz", hash = "sha256:2278b34c5d0dd78e087e1ca7f9b1dcbf129d80211afa645f214bd6e051037539"},
1347
  ]
1348
 
1349
+ [[package]]
1350
+ name = "tomlkit"
1351
+ version = "0.12.0"
1352
+ requires_python = ">=3.7"
1353
+ summary = "Style preserving TOML library"
1354
+ groups = ["default"]
1355
+ files = [
1356
+ {file = "tomlkit-0.12.0-py3-none-any.whl", hash = "sha256:926f1f37a1587c7a4f6c7484dae538f1345d96d793d9adab5d3675957b1d0766"},
1357
+ {file = "tomlkit-0.12.0.tar.gz", hash = "sha256:01f0477981119c7d8ee0f67ebe0297a7c95b14cf9f4b102b45486deb77018716"},
1358
+ ]
1359
+
1360
  [[package]]
1361
  name = "torch"
1362
  version = "2.5.1"
 
1443
  {file = "triton-3.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0f34f6e7885d1bf0eaaf7ba875a5f0ce6f3c13ba98f9503651c1e6dc6757ed5c"},
1444
  ]
1445
 
1446
+ [[package]]
1447
+ name = "typer"
1448
+ version = "0.13.0"
1449
+ requires_python = ">=3.7"
1450
+ summary = "Typer, build great CLIs. Easy to code. Based on Python type hints."
1451
+ groups = ["default"]
1452
+ marker = "sys_platform != \"emscripten\""
1453
+ dependencies = [
1454
+ "click>=8.0.0",
1455
+ "rich>=10.11.0",
1456
+ "shellingham>=1.3.0",
1457
+ "typing-extensions>=3.7.4.3",
1458
+ ]
1459
+ files = [
1460
+ {file = "typer-0.13.0-py3-none-any.whl", hash = "sha256:d85fe0b777b2517cc99c8055ed735452f2659cd45e451507c76f48ce5c1d00e2"},
1461
+ {file = "typer-0.13.0.tar.gz", hash = "sha256:f1c7198347939361eec90139ffa0fd8b3df3a2259d5852a0f7400e476d95985c"},
1462
+ ]
1463
+
1464
  [[package]]
1465
  name = "typing-extensions"
1466
  version = "4.12.2"
 
1472
  {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"},
1473
  ]
1474
 
1475
+ [[package]]
1476
+ name = "tzdata"
1477
+ version = "2024.2"
1478
+ requires_python = ">=2"
1479
+ summary = "Provider of IANA time zone data"
1480
+ groups = ["default"]
1481
+ files = [
1482
+ {file = "tzdata-2024.2-py2.py3-none-any.whl", hash = "sha256:a48093786cdcde33cad18c2555e8532f34422074448fbc874186f0abd79565cd"},
1483
+ {file = "tzdata-2024.2.tar.gz", hash = "sha256:7d85cc416e9382e69095b7bdf4afd9e3880418a2413feec7069d533d6b4e31cc"},
1484
+ ]
1485
+
1486
  [[package]]
1487
  name = "urllib3"
1488
  version = "2.2.3"
 
1510
  {file = "uvicorn-0.32.0.tar.gz", hash = "sha256:f78b36b143c16f54ccdb8190d0a26b5f1901fe5a3c777e1ab29f26391af8551e"},
1511
  ]
1512
 
1513
+ [[package]]
1514
+ name = "websockets"
1515
+ version = "12.0"
1516
+ requires_python = ">=3.8"
1517
+ summary = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)"
1518
+ groups = ["default"]
1519
+ files = [
1520
+ {file = "websockets-12.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:5d873c7de42dea355d73f170be0f23788cf3fa9f7bed718fd2830eefedce01b4"},
1521
+ {file = "websockets-12.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3f61726cae9f65b872502ff3c1496abc93ffbe31b278455c418492016e2afc8f"},
1522
+ {file = "websockets-12.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ed2fcf7a07334c77fc8a230755c2209223a7cc44fc27597729b8ef5425aa61a3"},
1523
+ {file = "websockets-12.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e332c210b14b57904869ca9f9bf4ca32f5427a03eeb625da9b616c85a3a506c"},
1524
+ {file = "websockets-12.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5693ef74233122f8ebab026817b1b37fe25c411ecfca084b29bc7d6efc548f45"},
1525
+ {file = "websockets-12.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e9e7db18b4539a29cc5ad8c8b252738a30e2b13f033c2d6e9d0549b45841c04"},
1526
+ {file = "websockets-12.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:6e2df67b8014767d0f785baa98393725739287684b9f8d8a1001eb2839031447"},
1527
+ {file = "websockets-12.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:bea88d71630c5900690fcb03161ab18f8f244805c59e2e0dc4ffadae0a7ee0ca"},
1528
+ {file = "websockets-12.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:dff6cdf35e31d1315790149fee351f9e52978130cef6c87c4b6c9b3baf78bc53"},
1529
+ {file = "websockets-12.0-cp311-cp311-win32.whl", hash = "sha256:3e3aa8c468af01d70332a382350ee95f6986db479ce7af14d5e81ec52aa2b402"},
1530
+ {file = "websockets-12.0-cp311-cp311-win_amd64.whl", hash = "sha256:25eb766c8ad27da0f79420b2af4b85d29914ba0edf69f547cc4f06ca6f1d403b"},
1531
+ {file = "websockets-12.0-py3-none-any.whl", hash = "sha256:dc284bbc8d7c78a6c69e0c7325ab46ee5e40bb4d50e494d8131a07ef47500e9e"},
1532
+ {file = "websockets-12.0.tar.gz", hash = "sha256:81df9cbcbb6c260de1e007e58c011bfebe2dafc8435107b0537f393dd38c8b1b"},
1533
+ ]
1534
+
1535
  [[package]]
1536
  name = "werkzeug"
1537
  version = "3.1.3"
pyproject.toml CHANGED
@@ -5,7 +5,7 @@ description = "Default template for PDM package"
5
  authors = [
6
  {name = "kaubarros-24", email = "[email protected]"},
7
  ]
8
- dependencies = ["fastapi>=0.115.4", "torch>=2.5.1", "tensorflow>=2.18.0", "huggingface-hub>=0.26.2", "huggingface>=0.0.1", "uvicorn>=0.32.0", "transformers>=4.46.2", "tf-keras>=2.18.0"]
9
  requires-python = "==3.11.*"
10
  readme = "README.md"
11
  license = {text = "MIT"}
 
5
  authors = [
6
  {name = "kaubarros-24", email = "[email protected]"},
7
  ]
8
+ dependencies = ["fastapi>=0.115.4", "torch>=2.5.1", "tensorflow>=2.18.0", "huggingface-hub>=0.26.2", "huggingface>=0.0.1", "uvicorn>=0.32.0", "transformers>=4.46.2", "tf-keras>=2.18.0", "gradio>=5.5.0"]
9
  requires-python = "==3.11.*"
10
  readme = "README.md"
11
  license = {text = "MIT"}
src/ai/main.py CHANGED
@@ -1,9 +1,13 @@
 
1
  from fastapi import FastAPI
2
  from transformers import pipeline
3
  from pydantic import BaseModel
 
 
4
 
5
  app = FastAPI()
6
 
 
7
  model_name = "potas_recommend"
8
  classifier = pipeline("text-classification", model=model_name)
9
 
@@ -27,7 +31,31 @@ async def ai(request: Request):
27
  f"Sub-area: {request.sub_area}."
28
  )
29
  result = classifier(text)
30
-
31
  return {"message": result}
32
  except BaseException as error:
33
- print(error)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
  from fastapi import FastAPI
3
  from transformers import pipeline
4
  from pydantic import BaseModel
5
+ import threading
6
+ import uvicorn
7
 
8
  app = FastAPI()
9
 
10
+ # Nome do modelo
11
  model_name = "potas_recommend"
12
  classifier = pipeline("text-classification", model=model_name)
13
 
 
31
  f"Sub-area: {request.sub_area}."
32
  )
33
  result = classifier(text)
 
34
  return {"message": result}
35
  except BaseException as error:
36
+ print(error)
37
+
38
+ # Função que o Gradio usará para a interface
39
+ def gradio_interface(audience, category, area, sub_area):
40
+ # Formatação do texto que será passado para o classificador
41
+ text = (
42
+ f"This ad is focused on: {audience}. "
43
+ f"Category: {category}. "
44
+ f"Area: {area}. "
45
+ f"Sub-area: {sub_area}."
46
+ )
47
+ result = classifier(text)
48
+ return result
49
+
50
+ gr_interface = gr.Interface(
51
+ fn=gradio_interface,
52
+ inputs=["text", "text", "text", "text"],
53
+ outputs="json",
54
+ live=True
55
+ )
56
+
57
+ def run_gradio():
58
+ gr_interface.launch(server_port=7860, share=True)
59
+ if __name__ == "__main__":
60
+ threading.Thread(target=run_gradio).start()
61
+ uvicorn.run(app, host="0.0.0.0", port=8080)