setup.py 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. # pylint: disable = C0111
  2. from setuptools import find_packages, setup
  3. with open("README.md", "r", encoding="utf-8") as f:
  4. # Remove GitHub dark mode images
  5. DESCRIPTION = "".join([line for line in f if "gh-dark-mode-only" not in line])
  6. # Required dependencies
  7. install = ["faiss-cpu>=1.7.1.post2", "msgpack>=1.0.7", "torch>=1.12.1", "transformers>=4.28.0"]
  8. # Required dependencies that are also transformers dependencies
  9. install += ["huggingface-hub>=0.19.0", "numpy>=1.18.4", "pyyaml>=5.3", "regex>=2022.8.17"]
  10. # Optional dependencies
  11. extras = {}
  12. # Development dependencies - not included in "all" install
  13. extras["dev"] = [
  14. "black",
  15. "coverage",
  16. "coveralls",
  17. "httpx",
  18. "mkdocs-material",
  19. "mkdocs-redirects",
  20. "mkdocstrings[python]",
  21. "pre-commit",
  22. "pylint",
  23. ]
  24. extras["ann"] = [
  25. "annoy>=1.16.3",
  26. "hnswlib>=0.5.0",
  27. "pgvector>=0.2.5",
  28. "sqlalchemy>=2.0.20",
  29. "sqlite-vec>=0.1.1",
  30. ]
  31. extras["api"] = [
  32. "aiohttp>=3.8.1",
  33. "fastapi>=0.94.0",
  34. "pillow>=7.1.2",
  35. "python-multipart>=0.0.7",
  36. "uvicorn>=0.12.1",
  37. ]
  38. extras["cloud"] = ["apache-libcloud>=3.3.1"]
  39. extras["console"] = ["rich>=12.0.1"]
  40. extras["database"] = ["duckdb>=0.7.1", "pillow>=7.1.2", "sqlalchemy>=2.0.20"]
  41. extras["graph"] = ["grand-cypher>=0.6.0", "grand-graph>=0.5.0", "networkx>=2.6.3", "python-louvain>=0.16", "sqlalchemy>=2.0.20"]
  42. extras["model"] = ["onnx>=1.11.0", "onnxruntime>=1.11.0"]
  43. extras["pipeline-audio"] = [
  44. "onnx>=1.11.0",
  45. "onnxruntime>=1.11.0",
  46. "scipy>=1.4.1",
  47. "sounddevice>=0.5.0",
  48. "soundfile>=0.10.3.post1",
  49. "ttstokenizer>=1.0.0",
  50. "webrtcvad-wheels>=2.0.14",
  51. ]
  52. extras["pipeline-data"] = ["beautifulsoup4>=4.9.3", "nltk>=3.5", "pandas>=1.1.0", "tika>=1.24"]
  53. extras["pipeline-image"] = ["imagehash>=4.2.1", "pillow>=7.1.2", "timm>=0.4.12"]
  54. extras["pipeline-llm"] = ["litellm>=1.37.16", "llama-cpp-python>=0.2.75"]
  55. extras["pipeline-text"] = ["fasttext>=0.9.2", "sentencepiece>=0.1.91"]
  56. extras["pipeline-train"] = [
  57. "accelerate>=0.26.0",
  58. "bitsandbytes>=0.42.0",
  59. "onnx>=1.11.0",
  60. "onnxmltools>=1.9.1",
  61. "onnxruntime>=1.11.0",
  62. "peft>=0.8.1",
  63. "skl2onnx>=1.9.1",
  64. ]
  65. extras["pipeline"] = (
  66. extras["pipeline-audio"]
  67. + extras["pipeline-data"]
  68. + extras["pipeline-image"]
  69. + extras["pipeline-llm"]
  70. + extras["pipeline-text"]
  71. + extras["pipeline-train"]
  72. )
  73. extras["scoring"] = ["sqlalchemy>=2.0.20"]
  74. extras["vectors"] = [
  75. "fasttext>=0.9.2",
  76. "litellm>=1.37.16",
  77. "llama-cpp-python>=0.2.75",
  78. "model2vec>=0.3.0",
  79. "pymagnitude-lite>=0.1.43",
  80. "scikit-learn>=0.23.1",
  81. "sentence-transformers>=2.2.0",
  82. "skops>=0.9.0",
  83. ]
  84. extras["workflow"] = [
  85. "apache-libcloud>=3.3.1",
  86. "croniter>=1.2.0",
  87. "openpyxl>=3.0.9",
  88. "pandas>=1.1.0",
  89. "pillow>=7.1.2",
  90. "requests>=2.26.0",
  91. "xmltodict>=0.12.0",
  92. ]
  93. # Backwards-compatible combination of ann and vectors extra
  94. extras["similarity"] = extras["ann"] + extras["vectors"]
  95. extras["all"] = (
  96. extras["api"]
  97. + extras["cloud"]
  98. + extras["console"]
  99. + extras["database"]
  100. + extras["graph"]
  101. + extras["model"]
  102. + extras["pipeline"]
  103. + extras["scoring"]
  104. + extras["similarity"]
  105. + extras["workflow"]
  106. )
  107. setup(
  108. name="txtai",
  109. version="7.6.0",
  110. author="NeuML",
  111. description="All-in-one open-source embeddings database for semantic search, LLM orchestration and language model workflows",
  112. long_description=DESCRIPTION,
  113. long_description_content_type="text/markdown",
  114. url="https://github.com/neuml/txtai",
  115. project_urls={
  116. "Documentation": "https://github.com/neuml/txtai",
  117. "Issue Tracker": "https://github.com/neuml/txtai/issues",
  118. "Source Code": "https://github.com/neuml/txtai",
  119. },
  120. license="Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0",
  121. packages=find_packages(where="src/python"),
  122. package_dir={"": "src/python"},
  123. keywords="search embedding machine-learning nlp",
  124. python_requires=">=3.9",
  125. install_requires=install,
  126. extras_require=extras,
  127. classifiers=[
  128. "License :: OSI Approved :: Apache Software License",
  129. "Operating System :: OS Independent",
  130. "Programming Language :: Python :: 3",
  131. "Topic :: Scientific/Engineering :: Artificial Intelligence",
  132. "Topic :: Software Development",
  133. "Topic :: Text Processing :: Indexing",
  134. "Topic :: Utilities",
  135. ],
  136. )