-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.py
93 lines (74 loc) · 2.49 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import os
import subprocess
import sys
from setuptools import find_packages, setup
def write_version_py():
with open(os.path.join("lighthubert", "version.txt")) as f:
version = f.read().strip()
# append latest commit hash to version string
try:
sha = (
subprocess.check_output(["git", "rev-parse", "HEAD"])
.decode("ascii")
.strip()
)
version += "+" + sha[:7]
except Exception:
pass
# write version info to lighthubert/version.py
with open(os.path.join("lighthubert", "version.py"), "w") as f:
f.write('__version__ = "{}"\n'.format(version))
return version
version = write_version_py()
with open("README.md") as f:
readme = f.read()
if "clean" in sys.argv[1:]:
# Source: https://bit.ly/2NLVsgE
print("deleting Cython files...")
import subprocess
subprocess.run(
["rm -f lighthubert/*.so lighthubert/**/*.so lighthubert/*.pyd lighthubert/**/*.pyd"],
shell=True,
)
requirements = [
"torch>=1.8.1",
"torchaudio>=0.8.1",
"torchvision>=0.9.1",
"numpy>=1.19.3",
]
def do_setup(package_data):
setup(
name="lighthubert",
version=version,
description="LightHuBERT: Lightweight and Configurable Speech Representation Learning with Once-for-All Hidden-Unit BERT",
long_description=readme,
long_description_content_type="text/markdown",
url="https://github.com/mechanicalsea/lighthubert",
author="LightHuBERT authors",
author_email="[email protected]",
classifiers=[
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Topic :: Scientific/Engineering :: Artificial Intelligence :: Speech",
],
keywords="speech pre-training, model compression, knowledge distillation, neural architecture search, Transformer",
packages=find_packages(
include=[
"lighthubert",
"lighthubert.*"
],
exclude=[
"config",
"config.*",
"tutorials",
]
),
# package_data=package_data,
python_requires=">=3.6",
install_requires=requirements,
)
if __name__ == "__main__":
do_setup(package_data=None)