|
1 | 1 | from __future__ import absolute_import |
2 | | - |
| 2 | +import os |
3 | 3 | from setuptools import find_packages, setup |
4 | 4 |
|
| 5 | +lib_folder = os.path.dirname(os.path.realpath(__file__)) |
| 6 | +requirements_path = f"{lib_folder}/requirements.txt" |
| 7 | +install_requires = [] # Here we'll add: ["gunicorn", "docutils>=0.3", "lxml==0.5a7"] |
| 8 | +if os.path.isfile(requirements_path): |
| 9 | + with open(requirements_path) as f: |
| 10 | + install_requires = f.read().splitlines() |
| 11 | + |
| 12 | +test_requirements_path = f"{lib_folder}/test-requirements.txt" |
| 13 | +if os.path.isfile(test_requirements_path): |
| 14 | + with open(test_requirements_path) as f: |
| 15 | + test_requirements = f.read().splitlines() |
| 16 | + |
5 | 17 | # We don't declare our dependency on transformers here because we build with |
6 | 18 | # different packages for different variants |
7 | 19 |
|
|
12 | 24 | # ffmpeg: ffmpeg is required for audio processing. On Ubuntu it can be installed as follows: apt install ffmpeg |
13 | 25 | # libavcodec-extra : libavcodec-extra includes additional codecs for ffmpeg |
14 | 26 |
|
15 | | -install_requires = [ |
16 | | - # Due to an error affecting kenlm and cmake (see https://github.com/kpu/kenlm/pull/464) |
17 | | - # Also see the transformers patch for it https://github.com/huggingface/transformers/pull/37091 |
18 | | - "kenlm@git+https://github.com/kpu/kenlm@ba83eafdce6553addd885ed3da461bb0d60f8df7", |
19 | | - "transformers[sklearn,sentencepiece,audio,vision]==4.51.3", |
20 | | - "huggingface_hub[hf_transfer,hf_xet]==0.31.1", |
21 | | - # vision |
22 | | - "Pillow", |
23 | | - "librosa", |
24 | | - # speech + torchaudio |
25 | | - "pyctcdecode>=0.3.0", |
26 | | - "phonemizer", |
27 | | - "ffmpeg", |
28 | | - # web api |
29 | | - "starlette", |
30 | | - "uvicorn", |
31 | | - "gunicorn", |
32 | | - "pandas", |
33 | | - "orjson", |
34 | | - "einops", |
35 | | - "timm", |
36 | | -] |
37 | | - |
38 | 27 | extras = {} |
39 | | - |
40 | 28 | extras["st"] = ["sentence_transformers==4.0.2"] |
41 | 29 | extras["diffusers"] = ["diffusers==0.33.1", "accelerate==1.6.0"] |
42 | 30 | # Includes `peft` as PEFT requires `torch` so having `peft` as a core dependency |
43 | 31 | # means that `torch` will be installed even if the `torch` extra is not specified. |
44 | 32 | extras["torch"] = ["torch==2.5.1", "torchvision", "torchaudio", "peft==0.15.1"] |
45 | | -extras["test"] = [ |
46 | | - "pytest==7.2.1", |
47 | | - "pytest-xdist", |
48 | | - "parameterized", |
49 | | - "psutil", |
50 | | - "datasets", |
51 | | - "pytest-sugar", |
52 | | - "mock==2.0.0", |
53 | | - "docker", |
54 | | - "requests", |
55 | | - "tenacity", |
56 | | -] |
57 | 33 | extras["quality"] = ["isort", "ruff"] |
| 34 | +extras["test"] = test_requirements |
58 | 35 | extras["inf2"] = ["optimum-neuron"] |
59 | 36 | extras["google"] = ["google-cloud-storage", "crcmod==1.7"] |
60 | 37 |
|
|
0 commit comments