handsomeboyMMk commited on
Commit
5ecb295
·
1 Parent(s): b972aa6

Upload setup with huggingface_hub

Browse files
Files changed (1) hide show
  1. setup +137 -0
setup ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from setuptools import find_packages, setup
2
+
3
+
4
+ def get_version() -> str:
5
+ rel_path = "src/huggingface_hub/__init__.py"
6
+ with open(rel_path, "r") as fp:
7
+ for line in fp.read().splitlines():
8
+ if line.startswith("__version__"):
9
+ delim = '"' if '"' in line else "'"
10
+ return line.split(delim)[1]
11
+ raise RuntimeError("Unable to find version string.")
12
+
13
+
14
+ install_requires = [
15
+ "filelock",
16
+ "fsspec>=2023.5.0",
17
+ "requests",
18
+ "tqdm>=4.42.1",
19
+ "pyyaml>=5.1",
20
+ "typing-extensions>=3.7.4.3", # to be able to import TypeAlias
21
+ "packaging>=20.9",
22
+ ]
23
+
24
+ extras = {}
25
+
26
+ extras["cli"] = [
27
+ "InquirerPy==0.3.4",
28
+ # Note: installs `prompt-toolkit` in the background
29
+ ]
30
+
31
+ extras["inference"] = [
32
+ "aiohttp", # for AsyncInferenceClient
33
+ # On Python 3.8, Pydantic 2.x and tensorflow don't play well together
34
+ # Let's limit pydantic to 1.x for now. Since Tensorflow 2.14, Python3.8 is not supported anyway so impact should be
35
+ # limited. We still trigger some CIs on Python 3.8 so we need this workaround.
36
+ # NOTE: when relaxing constraint to support v3.x, make sure to adapt `src/huggingface_hub/inference/_text_generation.py`.
37
+ "pydantic>1.1,<3.0; python_version>'3.8'",
38
+ "pydantic>1.1,<2.0; python_version=='3.8'",
39
+ ]
40
+
41
+ extras["torch"] = [
42
+ "torch",
43
+ ]
44
+
45
+ extras["fastai"] = [
46
+ "toml",
47
+ "fastai>=2.4",
48
+ "fastcore>=1.3.27",
49
+ ]
50
+
51
+ extras["tensorflow"] = ["tensorflow", "pydot", "graphviz"]
52
+
53
+
54
+ extras["testing"] = (
55
+ extras["cli"]
56
+ + extras["inference"]
57
+ + [
58
+ "jedi",
59
+ "Jinja2",
60
+ "pytest",
61
+ "pytest-cov",
62
+ "pytest-env",
63
+ "pytest-xdist",
64
+ "pytest-vcr", # to mock Inference
65
+ "pytest-asyncio", # for AsyncInferenceClient
66
+ "urllib3<2.0", # VCR.py broken with urllib3 2.0 (see https://urllib3.readthedocs.io/en/stable/v2-migration-guide.html)
67
+ "soundfile",
68
+ "Pillow",
69
+ "gradio", # to test webhooks
70
+ "numpy", # for embeddings
71
+ ]
72
+ )
73
+
74
+ # Typing extra dependencies list is duplicated in `.pre-commit-config.yaml`
75
+ # Please make sure to update the list there when adding a new typing dependency.
76
+ extras["typing"] = [
77
+ "typing-extensions>=4.8.0",
78
+ "types-PyYAML",
79
+ "types-requests",
80
+ "types-simplejson",
81
+ "types-toml",
82
+ "types-tqdm",
83
+ "types-urllib3",
84
+ ]
85
+
86
+ extras["quality"] = [
87
+ "ruff>=0.1.3",
88
+ "mypy==1.5.1",
89
+ ]
90
+
91
+ extras["all"] = extras["testing"] + extras["quality"] + extras["typing"]
92
+
93
+ extras["dev"] = extras["all"]
94
+
95
+ extras["docs"] = extras["all"] + [
96
+ # CI builds documentation using doc builder from source
97
+ "hf-doc-builder @ git+https://github.com/huggingface/doc-builder@main",
98
+ "watchdog",
99
+ ]
100
+
101
+
102
+ setup(
103
+ name="huggingface_hub",
104
+ version=get_version(),
105
+ author="Hugging Face, Inc.",
106
+ author_email="julien@huggingface.co",
107
+ description="Client library to download and publish models, datasets and other repos on the huggingface.co hub",
108
+ long_description=open("README.md", "r", encoding="utf-8").read(),
109
+ long_description_content_type="text/markdown",
110
+ keywords="model-hub machine-learning models natural-language-processing deep-learning pytorch pretrained-models",
111
+ license="Apache",
112
+ url="https://github.com/huggingface/huggingface_hub",
113
+ package_dir={"": "src"},
114
+ packages=find_packages("src"),
115
+ extras_require=extras,
116
+ entry_points={
117
+ "console_scripts": ["huggingface-cli=huggingface_hub.commands.huggingface_cli:main"],
118
+ "fsspec.specs": "hf=huggingface_hub.HfFileSystem",
119
+ },
120
+ python_requires=">=3.8.0",
121
+ install_requires=install_requires,
122
+ classifiers=[
123
+ "Intended Audience :: Developers",
124
+ "Intended Audience :: Education",
125
+ "Intended Audience :: Science/Research",
126
+ "License :: OSI Approved :: Apache Software License",
127
+ "Operating System :: OS Independent",
128
+ "Programming Language :: Python :: 3",
129
+ "Programming Language :: Python :: 3 :: Only",
130
+ "Programming Language :: Python :: 3.8",
131
+ "Programming Language :: Python :: 3.9",
132
+ "Programming Language :: Python :: 3.10",
133
+ "Programming Language :: Python :: 3.11",
134
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
135
+ ],
136
+ include_package_data=True,
137
+ )