Skip to content

Commit

Permalink
Fix EasyNMT, fasttext dependency installation problem on Python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Sirozha1337 committed May 12, 2024
1 parent 1cbd6df commit dee8ccd
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 15 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]
python-version: ["3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -16,8 +16,10 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install application
run: |
pip install wheel
pip install -e .
python -m venv ./venv
./venv/bin/pip install --no-deps EasyNMT==2.0.2
./venv/bin/pip list
./venv/bin/pip install -v -e .
- name: Check that package was installed successfully
run: |
faster_auto_subtitle -h
12 changes: 8 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ faster-whisper==0.10.0
tqdm==4.56.0
ffmpeg-python==0.2.0
wheel==0.42.0
fasttext==0.9.2
pybind11==2.11.1
EasyNMT==2.0.2
langcodes==3.3.0
langcodes==3.3.0
transformers>=4.4,<5
torch>=1.6.0
numpy
nltk
sentencepiece
protobuf
EasyNMT==2.0.2
34 changes: 26 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,37 @@
from setuptools import setup, find_packages
from importlib.metadata import version, PackageNotFoundError

dependencies = [
'faster-whisper',
'tqdm',
'ffmpeg-python',
'langcodes',
'transformers>=4.4,<5',
'torch>=1.6.0',
'numpy',
'nltk',
'sentencepiece',
'protobuf',
]

print('checking EasyNMT')
try:
if not version('EasyNMT') == '2.0.2':
print('EasyNMT wrong version. Installing it now')
dependencies.append('EasyNMT==2.0.2')
except PackageNotFoundError as e:
print('Error:')
print(e)
print('EasyNMT is not installed. Installing it now')
dependencies.append('EasyNMT==2.0.2')

setup(
version="1.1",
name="faster_auto_subtitle",
packages=find_packages(),
py_modules=["auto_subtitle"],
author="Sergey Chernyaev",
install_requires=[
'faster-whisper',
'tqdm',
'ffmpeg-python',
'fasttext',
'EasyNMT',
'langcodes',
],
install_requires=dependencies,
description="Automatically generate and embed subtitles into your videos",
entry_points={
'console_scripts': ['faster_auto_subtitle=auto_subtitle.cli:main'],
Expand Down

0 comments on commit dee8ccd

Please sign in to comment.