Upload 8 files
Browse files- .gitignore +15 -0
- CONTRIBUTING.md +31 -0
- LICENSE +21 -0
- MANIFEST.in +3 -0
- requirements.conversion.txt +1 -0
- requirements.txt +5 -0
- setup.cfg +9 -0
- setup.py +68 -0
.gitignore
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Byte-compiled / Optimized / DLL Files
|
| 2 |
+
*.pyc
|
| 3 |
+
*.pyo
|
| 4 |
+
*.pyd
|
| 5 |
+
__pycache__/
|
| 6 |
+
|
| 7 |
+
# Distribution / Packaging
|
| 8 |
+
venv/
|
| 9 |
+
|
| 10 |
+
# Unit Test
|
| 11 |
+
.pytest_cache/
|
| 12 |
+
|
| 13 |
+
# Ignore IDE, Editor Files
|
| 14 |
+
.idea/
|
| 15 |
+
.vscode/
|
CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Contributing to faster-whisper
|
| 2 |
+
|
| 3 |
+
Contributions are welcome! Here are some pointers to help you install the library for development and validate your changes before submitting a pull request.
|
| 4 |
+
|
| 5 |
+
## Install the library for development
|
| 6 |
+
|
| 7 |
+
We recommend installing the module in editable mode with the `dev` extra requirements:
|
| 8 |
+
|
| 9 |
+
```bash
|
| 10 |
+
git clone https://github.com/SYSTRAN/faster-whisper.git
|
| 11 |
+
cd faster-whisper/
|
| 12 |
+
pip install -e .[dev]
|
| 13 |
+
```
|
| 14 |
+
|
| 15 |
+
## Validate the changes before creating a pull request
|
| 16 |
+
|
| 17 |
+
1. Make sure the existing tests are still passing (and consider adding new tests as well!):
|
| 18 |
+
|
| 19 |
+
```bash
|
| 20 |
+
pytest tests/
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
2. Reformat and validate the code with the following tools:
|
| 24 |
+
|
| 25 |
+
```bash
|
| 26 |
+
black .
|
| 27 |
+
isort .
|
| 28 |
+
flake8 .
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
These steps are also run automatically in the CI when you open the pull request.
|
LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2023 SYSTRAN
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
MANIFEST.in
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
include faster_whisper/assets/silero_vad.onnx
|
| 2 |
+
include requirements.txt
|
| 3 |
+
include requirements.conversion.txt
|
requirements.conversion.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
transformers[torch]>=4.23
|
requirements.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
av>=11.0,<13
|
| 2 |
+
ctranslate2>=4.0,<5
|
| 3 |
+
huggingface_hub>=0.13
|
| 4 |
+
tokenizers>=0.13,<1
|
| 5 |
+
onnxruntime>=1.14,<2
|
setup.cfg
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[flake8]
|
| 2 |
+
max-line-length = 100
|
| 3 |
+
ignore =
|
| 4 |
+
E203,
|
| 5 |
+
W503,
|
| 6 |
+
|
| 7 |
+
[isort]
|
| 8 |
+
profile=black
|
| 9 |
+
lines_between_types=1
|
setup.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
|
| 3 |
+
from setuptools import find_packages, setup
|
| 4 |
+
|
| 5 |
+
base_dir = os.path.dirname(os.path.abspath(__file__))
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
def get_long_description():
|
| 9 |
+
readme_path = os.path.join(base_dir, "README.md")
|
| 10 |
+
with open(readme_path, encoding="utf-8") as readme_file:
|
| 11 |
+
return readme_file.read()
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
def get_project_version():
|
| 15 |
+
version_path = os.path.join(base_dir, "faster_whisper", "version.py")
|
| 16 |
+
version = {}
|
| 17 |
+
with open(version_path, encoding="utf-8") as fp:
|
| 18 |
+
exec(fp.read(), version)
|
| 19 |
+
return version["__version__"]
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
def get_requirements(path):
|
| 23 |
+
with open(path, encoding="utf-8") as requirements:
|
| 24 |
+
return [requirement.strip() for requirement in requirements]
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
install_requires = get_requirements(os.path.join(base_dir, "requirements.txt"))
|
| 28 |
+
conversion_requires = get_requirements(
|
| 29 |
+
os.path.join(base_dir, "requirements.conversion.txt")
|
| 30 |
+
)
|
| 31 |
+
|
| 32 |
+
setup(
|
| 33 |
+
name="faster-whisper",
|
| 34 |
+
version=get_project_version(),
|
| 35 |
+
license="MIT",
|
| 36 |
+
description="Faster Whisper transcription with CTranslate2",
|
| 37 |
+
long_description=get_long_description(),
|
| 38 |
+
long_description_content_type="text/markdown",
|
| 39 |
+
author="Guillaume Klein",
|
| 40 |
+
url="https://github.com/SYSTRAN/faster-whisper",
|
| 41 |
+
classifiers=[
|
| 42 |
+
"Development Status :: 4 - Beta",
|
| 43 |
+
"Intended Audience :: Developers",
|
| 44 |
+
"Intended Audience :: Science/Research",
|
| 45 |
+
"License :: OSI Approved :: MIT License",
|
| 46 |
+
"Programming Language :: Python :: 3",
|
| 47 |
+
"Programming Language :: Python :: 3 :: Only",
|
| 48 |
+
"Programming Language :: Python :: 3.8",
|
| 49 |
+
"Programming Language :: Python :: 3.9",
|
| 50 |
+
"Programming Language :: Python :: 3.10",
|
| 51 |
+
"Programming Language :: Python :: 3.11",
|
| 52 |
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
| 53 |
+
],
|
| 54 |
+
keywords="openai whisper speech ctranslate2 inference quantization transformer",
|
| 55 |
+
python_requires=">=3.8",
|
| 56 |
+
install_requires=install_requires,
|
| 57 |
+
extras_require={
|
| 58 |
+
"conversion": conversion_requires,
|
| 59 |
+
"dev": [
|
| 60 |
+
"black==23.*",
|
| 61 |
+
"flake8==6.*",
|
| 62 |
+
"isort==5.*",
|
| 63 |
+
"pytest==7.*",
|
| 64 |
+
],
|
| 65 |
+
},
|
| 66 |
+
packages=find_packages(),
|
| 67 |
+
include_package_data=True,
|
| 68 |
+
)
|