setup.py 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. #!/usr/bin/env python3
  2. """FunASR setup script."""
  3. import os
  4. from distutils.version import LooseVersion
  5. from setuptools import find_packages
  6. from setuptools import setup
  7. requirements = {
  8. "install": [
  9. "setuptools>=38.5.1",
  10. "configargparse>=1.2.1",
  11. "typeguard>=2.7.0",
  12. "humanfriendly",
  13. "scipy>=1.4.1",
  14. "filelock",
  15. "librosa>=0.8.0",
  16. "jamo==0.4.1", # For kss
  17. "PyYAML>=5.1.2",
  18. "soundfile>=0.10.2",
  19. "h5py>=2.10.0",
  20. "kaldiio>=2.17.0",
  21. "torch_complex",
  22. "nltk>=3.4.5",
  23. # ASR
  24. "sentencepiece",
  25. "ctc-segmentation<1.8,>=1.6.6",
  26. # TTS
  27. "pyworld>=0.2.10",
  28. "pypinyin<=0.44.0",
  29. "espnet_tts_frontend",
  30. # ENH
  31. "ci_sdr",
  32. "pytorch_wpe",
  33. "editdistance==0.5.2",
  34. "tensorboard>=1.14",
  35. "g2p",
  36. ],
  37. # train: The modules invoked when training only.
  38. "train": [
  39. "pillow>=6.1.0",
  40. "editdistance==0.5.2",
  41. "wandb",
  42. ],
  43. # recipe: The modules actually are not invoked in the main module of funasr,
  44. # but are invoked for the python scripts in each recipe
  45. "recipe": [
  46. "espnet_model_zoo",
  47. "gdown",
  48. "resampy",
  49. "pysptk>=0.1.17",
  50. "morfessor", # for zeroth-korean
  51. "youtube_dl", # for laborotv
  52. "nnmnkwii",
  53. "museval>=0.2.1",
  54. "pystoi>=0.2.2",
  55. "mir-eval>=0.6",
  56. "fastdtw",
  57. "nara_wpe>=0.0.5",
  58. "sacrebleu>=1.5.1",
  59. ],
  60. # all: The modules should be optionally installled due to some reason.
  61. # Please consider moving them to "install" occasionally
  62. # NOTE(kamo): The modules in "train" and "recipe" are appended into "all"
  63. "all": [
  64. # NOTE(kamo): Append modules requiring specific pytorch version or torch>1.3.0
  65. "torch_optimizer",
  66. "fairscale",
  67. "transformers",
  68. "gtn==0.0.0",
  69. ],
  70. "setup": [
  71. "numpy<=1.21.3",
  72. "pytest-runner",
  73. ],
  74. "test": [
  75. "pytest>=3.3.0",
  76. "pytest-timeouts>=1.2.1",
  77. "pytest-pythonpath>=0.7.3",
  78. "pytest-cov>=2.7.1",
  79. "hacking>=2.0.0",
  80. "mock>=2.0.0",
  81. "pycodestyle",
  82. "jsondiff<2.0.0,>=1.2.0",
  83. "flake8>=3.7.8",
  84. "flake8-docstrings>=1.3.1",
  85. "black",
  86. ],
  87. "doc": [
  88. "Jinja2<3.1",
  89. "Sphinx==2.1.2",
  90. "sphinx-rtd-theme>=0.2.4",
  91. "sphinx-argparse>=0.2.5",
  92. "commonmark==0.8.1",
  93. "recommonmark>=0.4.0",
  94. "nbsphinx>=0.4.2",
  95. "sphinx-markdown-tables>=0.0.12",
  96. ],
  97. }
  98. requirements["all"].extend(requirements["train"] + requirements["recipe"])
  99. requirements["test"].extend(requirements["train"])
  100. install_requires = requirements["install"]
  101. setup_requires = requirements["setup"]
  102. tests_require = requirements["test"]
  103. extras_require = {
  104. k: v for k, v in requirements.items() if k not in ["install", "setup"]
  105. }
  106. dirname = os.path.dirname(__file__)
  107. version_file = os.path.join(dirname, "funasr", "version.txt")
  108. with open(version_file, "r") as f:
  109. version = f.read().strip()
  110. setup(
  111. name="funasr",
  112. version=version,
  113. url="https://github.com/alibaba-damo-academy/FunASR.git",
  114. author="Speech Lab, Alibaba Group, China",
  115. author_email="funasr@list.alibaba-inc.com",
  116. description="FunASR: A Fundamental End-to-End Speech Recognition Toolkit",
  117. long_description=open(os.path.join(dirname, "README.md"), encoding="utf-8").read(),
  118. long_description_content_type="text/markdown",
  119. license="The MIT License",
  120. packages=find_packages(include=["funasr*"]),
  121. package_data={"funasr": ["version.txt"]},
  122. install_requires=install_requires,
  123. setup_requires=setup_requires,
  124. tests_require=tests_require,
  125. extras_require=extras_require,
  126. python_requires=">=3.7.0",
  127. classifiers=[
  128. "Programming Language :: Python",
  129. "Programming Language :: Python :: 3",
  130. "Programming Language :: Python :: 3.7",
  131. "Programming Language :: Python :: 3.8",
  132. "Programming Language :: Python :: 3.9",
  133. "Development Status :: 5 - Production/Stable",
  134. "Intended Audience :: Science/Research",
  135. "Operating System :: POSIX :: Linux",
  136. "License :: OSI Approved :: Apache Software License",
  137. "Topic :: Software Development :: Libraries :: Python Modules",
  138. ],
  139. )