diff options
author | Adam J. Stewart <ajstewart426@gmail.com> | 2024-11-18 20:51:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-18 11:51:16 -0800 |
commit | a6fdd7608f926e9d715cc672a0872f427510f601 (patch) | |
tree | 4ddd681c9520bbf50fa93f365a772721ea78e391 /var | |
parent | 1ffd7125a666c2d45a3706751a8c1e56ec96b714 (diff) | |
download | spack-a6fdd7608f926e9d715cc672a0872f427510f601.tar.gz spack-a6fdd7608f926e9d715cc672a0872f427510f601.tar.bz2 spack-a6fdd7608f926e9d715cc672a0872f427510f601.tar.xz spack-a6fdd7608f926e9d715cc672a0872f427510f601.zip |
py-huggingface-hub: add v0.26.2, hf_transfer (#47600)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/py-hf-transfer/package.py | 20 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/py-huggingface-hub/package.py | 50 |
2 files changed, 54 insertions, 16 deletions
diff --git a/var/spack/repos/builtin/packages/py-hf-transfer/package.py b/var/spack/repos/builtin/packages/py-hf-transfer/package.py new file mode 100644 index 0000000000..3dab2ffe99 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-hf-transfer/package.py @@ -0,0 +1,20 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyHfTransfer(PythonPackage): + """Speed up file transfers with the Hugging Face Hub.""" + + homepage = "https://github.com/huggingface/hf_transfer" + pypi = "hf_transfer/hf_transfer-0.1.8.tar.gz" + + license("Apache-2.0") + + version("0.1.8", sha256="26d229468152e7a3ec12664cac86b8c2800695fd85f9c9a96677a775cc04f0b3") + + with default_args(type="build"): + depends_on("py-maturin@1.4:1") diff --git a/var/spack/repos/builtin/packages/py-huggingface-hub/package.py b/var/spack/repos/builtin/packages/py-huggingface-hub/package.py index 2de20bed53..f73029b429 100644 --- a/var/spack/repos/builtin/packages/py-huggingface-hub/package.py +++ b/var/spack/repos/builtin/packages/py-huggingface-hub/package.py @@ -7,15 +7,16 @@ from spack.package import * class PyHuggingfaceHub(PythonPackage): - """This library allows anyone to work with the Hub - repositories: you can clone them, create them and upload - your models to them.""" + """Client library to download and publish models, datasets and other repos + on the huggingface.co hub.""" homepage = "https://github.com/huggingface/huggingface_hub" pypi = "huggingface_hub/huggingface_hub-0.0.10.tar.gz" license("Apache-2.0") + maintainers("adamjstewart") + version("0.26.2", sha256="b100d853465d965733964d123939ba287da60a547087783ddff8a323f340332b") version("0.24.6", sha256="cc2579e761d070713eaa9c323e3debe39d5b464ae3a7261c39a9195b27bb8000") version("0.23.4", sha256="35d99016433900e44ae7efe1c209164a5a81dbbcd53a52f99c281dcd7ce22431") version("0.19.4", sha256="176a4fc355a851c17550e7619488f383189727eab209534d7cef2114dae77b22") @@ -30,17 +31,34 @@ class PyHuggingfaceHub(PythonPackage): when="@0.10:", description="Install dependencies for CLI-specific features", ) + variant( + "hf_transfer", + default=False, + when="@0.21:", + description="Install hf_transfer to speed up downloads/uploads", + ) + + with default_args(type="build"): + depends_on("py-setuptools") + + with default_args(type=("build", "run")): + depends_on("py-filelock") + depends_on("py-fsspec@2023.5:", when="@0.18:") + depends_on("py-fsspec", when="@0.14:") + depends_on("py-packaging@20.9:", when="@0.10:") + depends_on("py-pyyaml@5.1:", when="@0.10:") + depends_on("py-requests") + depends_on("py-tqdm@4.42.1:", when="@0.12:") + depends_on("py-tqdm") + depends_on("py-typing-extensions@3.7.4.3:", when="@0.10:") + depends_on("py-typing-extensions", when="@0.0.10:") + + with when("+cli"): + depends_on("py-inquirerpy@0.3.4") + + with when("+hf_transfer"): + depends_on("py-hf-transfer@0.1.4:") - depends_on("py-setuptools", type="build") - depends_on("py-filelock", type=("build", "run")) - depends_on("py-fsspec@2023.5:", when="@0.18:", type=("build", "run")) - depends_on("py-fsspec", when="@0.14:", type=("build", "run")) - depends_on("py-packaging@20.9:", when="@0.10:", type=("build", "run")) - depends_on("py-pyyaml@5.1:", when="@0.10:", type=("build", "run")) - depends_on("py-requests", type=("build", "run")) - depends_on("py-tqdm@4.42.1:", when="@0.12:", type=("build", "run")) - depends_on("py-tqdm", type=("build", "run")) - depends_on("py-typing-extensions@3.7.4.3:", when="@0.10:", type=("build", "run")) - depends_on("py-typing-extensions", when="@0.0.10:", type=("build", "run")) - - depends_on("py-inquirerpy@0.3.4", when="@0.14:+cli", type=("build", "run")) + def setup_run_environment(self, env): + if "+hf_transfer" in self.spec: + env.set("HF_HUB_ENABLE_HF_TRANSFER", 1) |