setup.py 4.0 KB

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