setup.py 3.8 KB

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