add custom huggingface_hub packages (learning from hf-cli's authentication workflow)
This commit is contained in:
parent
d68132b8fb
commit
7ab29bfe07
3 changed files with 153 additions and 0 deletions
62
hosts/packages/huggingface_hub/huggingface_hub.nix
Normal file
62
hosts/packages/huggingface_hub/huggingface_hub.nix
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* WARNING: Just use `pkgs.python312Packages.huggingface-hub` (or change python version)
|
||||
* WARNING: I didn't realise it existed when I packaged this.
|
||||
*
|
||||
* Nix Resources:
|
||||
* 1. https://wiki.nixos.org/wiki/Python
|
||||
* 2. https://nixos.org/manual/nixpkgs/unstable/#developing-with-python
|
||||
*
|
||||
* Hugging Face Resources:
|
||||
* 1. https://github.com/huggingface/huggingface_hub
|
||||
* 2. https://huggingface.co/docs/huggingface_hub/main/en/guides/cli
|
||||
*/
|
||||
{
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
fetchPypi,
|
||||
# build time dependencies
|
||||
setuptools,
|
||||
# runtime dependencies
|
||||
filelock,
|
||||
fsspec,
|
||||
hf-xet,
|
||||
pyyaml,
|
||||
requests,
|
||||
tqdm,
|
||||
typing-extensions,
|
||||
}:
|
||||
buildPythonPackage rec {
|
||||
pname = "huggingface_hub";
|
||||
version = "0.34.3";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
hash = "sha256-1YEw/VqnQISAaBR1SRwKvX6DVEIIL7w+9NRbbDn4OFM=";
|
||||
};
|
||||
|
||||
pyproject = true;
|
||||
doCheck = false; # skip unit testing
|
||||
pythonImportsCheck = ["huggingface_hub"];
|
||||
|
||||
# buildtime dependencies
|
||||
build-system = [
|
||||
setuptools
|
||||
];
|
||||
# runtime dependencies
|
||||
dependencies = [
|
||||
filelock
|
||||
fsspec
|
||||
hf-xet
|
||||
pyyaml
|
||||
requests
|
||||
tqdm
|
||||
typing-extensions
|
||||
];
|
||||
|
||||
meta = rec {
|
||||
description = "The official Python client for the Huggingface Hub.";
|
||||
homepage = "https://github.com/huggingface/huggingface_hub";
|
||||
changelog = "${homepage}/releases/tag/v${version}";
|
||||
license = lib.licenses.asl20; # Apache License 2.0
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue