Skip to content

Commit fb9a518

Browse files
committed
use pyproject toml and support TF 2.15
1 parent a055d9a commit fb9a518

File tree

15 files changed

+225
-388
lines changed

15 files changed

+225
-388
lines changed

.github/workflows/ci-pipeline.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,17 @@ jobs:
2828
sudo apt-get -y install espeak libespeak1 libespeak-dev espeak-data
2929
sudo apt-get -y install libsndfile-dev
3030
python -m pip install --upgrade pip
31-
python -m pip install --upgrade setuptools wheel
32-
cat requirements.txt | xargs -L 1 pip install
33-
cat requirements-stretch.txt | xargs -L 1 pip install
34-
cat requirements-llm.txt | xargs -L 1 pip install
35-
cat requirements-dev.txt | xargs -L 1 pip install
36-
cat requirements-site.txt | xargs -L 1 pip install
37-
pip install -e . --ignore-installed
31+
pip install -e .
32+
pip install -e ".[stretch]"
33+
pip install -e ".[llm]"
34+
pip install -e ".[dev]"
35+
pip install -e ".[site]"
3836
- name: Type checking
3937
run: |
4038
python -m mypy --follow-imports=normal subaligner
4139
- name: Linting
4240
run: |
43-
pycodestyle subaligner tests examples misc bin/subaligner bin/subaligner_1pass bin/subaligner_2pass bin/subaligner_batch bin/subaligner_convert bin/subaligner_train bin/subaligner_tune setup.py --ignore=E203,E501,W503 --exclude="subaligner/lib"
41+
pycodestyle subaligner tests examples misc bin/subaligner bin/subaligner_1pass bin/subaligner_2pass bin/subaligner_batch bin/subaligner_convert bin/subaligner_train bin/subaligner_tune setup.py --ignore=E203,E501,E902,W503 --exclude="subaligner/lib"
4442
- name: Linting docstring
4543
run: |
4644
darglint -v 2 subaligner

Pipfile

Lines changed: 0 additions & 97 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,10 @@ $ subaligner --languages
131131
$ subaligner -m single -v video.mp4 -s subtitle.srt -t src,tgt
132132
$ subaligner -m dual -v video.mp4 -s subtitle.srt -t src,tgt
133133
$ subaligner -m script -v test.mp4 -s subtitle.txt -o subtitle_aligned.srt -t src,tgt
134-
$ subaligner -m dual -v video.mp4 -tr helsinki-nlp -o subtitle_aligned.srt -t src,tgt
135-
$ subaligner -m dual -v video.mp4 -tr facebook-mbart -tf large -o subtitle_aligned.srt -t src,tgt
136-
$ subaligner -m dual -v video.mp4 -tr whisper -tf small -o subtitle_aligned.srt -t src,eng
134+
$ subaligner -m dual -v video.mp4 -s subtitle.srt -tr helsinki-nlp -o subtitle_aligned.srt -t src,tgt
135+
$ subaligner -m dual -v video.mp4 -s subtitle.srt -tr facebook-mbart -tf large -o subtitle_aligned.srt -t src,tgt
136+
$ subaligner -m dual -v video.mp4 -s subtitle.srt -tr facebook-m2m100 -tf small -o subtitle_aligned.srt -t src,tgt
137+
$ subaligner -m dual -v video.mp4 -s subtitle.srt -tr whisper -tf small -o subtitle_aligned.srt -t src,eng
137138
```
138139
```
139140
# Transcribe audiovisual files and generate translated subtitles

pyproject.toml

Lines changed: 165 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,169 @@
11
[build-system]
2-
requires = ["setuptools<65.0.0", "wheel", "Cython"]
2+
requires = ["setuptools<65.0.0", "setuptools-scm", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "subaligner"
7+
version = "0.3.9"
8+
authors = [
9+
{ name = "Xi Bai", email = "xi.bai.ed@gmail.com" }
10+
]
11+
description = "Automatically synchronize and translate subtitles, or create new ones by transcribing, using pre-trained DNNs, Forced Alignments and Transformers."
12+
readme = { file = "README.md", content-type = "text/markdown" }
13+
urls = { "Homepage" = "https://github.com/baxtree/subaligner", "Documentation" = "https://subaligner.readthedocs.io/en/latest/", "Source" = "https://github.com/baxtree/subaligner" }
14+
classifiers = [
15+
"License :: OSI Approved :: MIT License",
16+
"Programming Language :: Python :: 3.8",
17+
"Programming Language :: Python :: 3.9",
18+
"Programming Language :: Python :: 3.10",
19+
"Programming Language :: Python :: 3.11",
20+
"Intended Audience :: Developers",
21+
"Topic :: Utilities"
22+
]
23+
dependencies = [
24+
"astor==0.7.1",
25+
"beautifulsoup4<4.9.0",
26+
"bleach==3.3.0",
27+
"cachetools==3.1.1",
28+
"captionstransformer~=1.2.1",
29+
"certifi==2023.7.22",
30+
"chardet~=3.0.4",
31+
"cloudpickle~=1.6.0",
32+
"cycler==0.10.0",
33+
"decorator==4.3.0",
34+
"distributed==2021.10.0",
35+
"filelock<4.0.0",
36+
"google-pasta~=0.2",
37+
"graphviz==0.8.3",
38+
"HeapDict==1.0.0",
39+
"h5py<4.0.0",
40+
"html5lib==1.0b9",
41+
"hyperopt==0.2.4",
42+
"idna==2.8",
43+
"isort==4.3.4",
44+
"joblib>=1.2.0",
45+
"le-pycaption==2.2.0a1",
46+
"librosa<0.10.0",
47+
"locket==0.2.0",
48+
"Markdown==2.6.11",
49+
"mccabe==0.6.1",
50+
"networkx>=2.5.1",
51+
"numba>=0.50.0",
52+
"numpy<1.27.0",
53+
"oauthlib==3.1.0",
54+
"pbr==4.0.2",
55+
"pkgconfig~=1.5.5",
56+
"pluggy==0.13.1",
57+
"pyasn1==0.4.8",
58+
"pyasn1-modules==0.2.7",
59+
"pybind11~=2.11.1",
60+
"pycountry~=20.7.3",
61+
"pydot==1.2.4",
62+
"pydot-ng==1.0.0",
63+
"pydotplus==2.0.2",
64+
"pyprof2calltree==1.4.3",
65+
"pysrt==1.1.2",
66+
"pysubs2~=1.6.1",
67+
"pytz==2018.4",
68+
"PyYAML>=4.2b1",
69+
"rsa==4.7",
70+
"scipy<1.12.0",
71+
"scikit-learn<1.2.0",
72+
"six~=1.15.0",
73+
"tensorflow>=1.15.5,<2.16.0",
74+
"termcolor==1.1.0",
75+
"toml==0.10.0",
76+
"toolz==0.9.0",
77+
"urllib3~=1.26.5",
78+
"wrapt==1.14.0",
79+
"Werkzeug>=0.15.3",
80+
"zict==0.1.3"
81+
]
82+
requires-python = ">=3.8,<3.12"
83+
84+
[project.optional-dependencies]
85+
harmony = [
86+
"aeneas~=1.7.3.0",
87+
"dtw-python~=1.5.3",
88+
"sentencepiece~=0.1.95",
89+
"torch<2.3.0",
90+
"torchaudio<2.3.0",
91+
"transformers<4.37.0",
92+
"openai-whisper==20240930"
93+
]
94+
dev = [
95+
"aeneas~=1.7.3.0",
96+
"dtw-python~=1.5.3",
97+
"sentencepiece~=0.1.95",
98+
"torch<2.3.0",
99+
"torchaudio<2.3.0",
100+
"transformers<4.37.0",
101+
"openai-whisper==20240930",
102+
"mock==4.0.3",
103+
"coverage==5.5",
104+
"tox~=3.23.0",
105+
"pycodestyle==2.12.1",
106+
"twine<4.0.0",
107+
"snakeviz==2.1.0",
108+
"line-profiler~=4.1.2",
109+
"scikit-build==0.11.1",
110+
"radish-bdd~=0.13.3",
111+
"pex<=2.1.80",
112+
"mypy==1.3.0",
113+
"types-requests==2.27.9",
114+
"types-setuptools==64.0.1",
115+
"typing-extensions==4.5.0",
116+
"parameterized==0.8.1",
117+
"pylint~=2.17.2",
118+
"pygments==2.7.4",
119+
"darglint~=1.8.1"
120+
]
121+
docs = [
122+
"sphinx==6.2.1",
123+
"sphinx-rtd-theme==2.0.0"
124+
]
125+
stretch = [
126+
"aeneas~=1.7.3.0",
127+
"dtw-python~=1.5.3"
128+
]
129+
llm = [
130+
"sentencepiece~=0.1.95",
131+
"torch<2.3.0",
132+
"torchaudio<2.3.0",
133+
"transformers<4.37.0",
134+
"openai-whisper==20240930"
135+
]
136+
137+
[project.scripts]
138+
subaligner = "subaligner.__main__:main"
139+
subaligner_1pass = "subaligner.subaligner_1pass.__main__:main"
140+
subaligner_2pass = "subaligner.subaligner_2pass.__main__:main"
141+
subaligner_batch = "subaligner.subaligner_batch.__main__:main"
142+
subaligner_convert = "subaligner.subaligner_convert.__main__:main"
143+
subaligner_train = "subaligner.subaligner_train.__main__:main"
144+
subaligner_tune = "subaligner.subaligner_tune.__main__:main"
145+
146+
[tool.setuptools.packages.find]
147+
include = [
148+
"subaligner",
149+
"subaligner.lib",
150+
"subaligner.subaligner_1pass",
151+
"subaligner.subaligner_2pass",
152+
"subaligner.subaligner_batch",
153+
"subaligner.subaligner_convert",
154+
"subaligner.subaligner_train",
155+
"subaligner.subaligner_tune",
156+
"subaligner.models.training.model",
157+
"subaligner.models.training.weights",
158+
"subaligner.models.training.config",
159+
]
160+
161+
[tool.setuptools.package-data]
162+
"subaligner.models.training.model" = ["model.hdf5"]
163+
"subaligner.models.training.weights" = ["weights.hdf5"]
164+
"subaligner.models.training.config" = ["hyperparameters.json"]
3165

4166
[tool.pydoclint]
5-
style = 'sphinx'
6-
exclude = '\.git|\.tox'
167+
style = "sphinx"
168+
exclude = "\\.git|\\.tox"
7169
require-return-section-when-returning-nothing = true

requirements-arm64.txt

Lines changed: 0 additions & 60 deletions
This file was deleted.

requirements-dev.txt

Lines changed: 0 additions & 18 deletions
This file was deleted.

requirements-llm.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)