From 0d415c830712003ac0ffd42d053d5198b9066d60 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 1 Apr 2025 00:21:53 +0200 Subject: [PATCH] python312Packages.huggingface-hub: add optional-dependencies --- .../huggingface-hub/default.nix | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/pkgs/development/python-modules/huggingface-hub/default.nix b/pkgs/development/python-modules/huggingface-hub/default.nix index c3344fa45ca2..33d2245a9806 100644 --- a/pkgs/development/python-modules/huggingface-hub/default.nix +++ b/pkgs/development/python-modules/huggingface-hub/default.nix @@ -14,6 +14,27 @@ requests, tqdm, typing-extensions, + + # optional-dependencies + # cli + inquirerpy, + # inference + aiohttp, + # torch + torch, + safetensors, + # hf_transfer + hf-transfer, + # fastai + toml, + fastai, + fastcore, + # tensorflow + tensorflow, + pydot, + graphviz, + # tensorflow-testing + keras, }: buildPythonPackage rec { @@ -40,6 +61,42 @@ buildPythonPackage rec { typing-extensions ]; + optional-dependencies = { + all = [ + + ]; + cli = [ + inquirerpy + ]; + inference = [ + aiohttp + ]; + torch = [ + torch + safetensors + ] ++ safetensors.optional-dependencies.torch; + hf_transfer = [ + hf-transfer + ]; + fastai = [ + toml + fastai + fastcore + ]; + tensorflow = [ + tensorflow + pydot + graphviz + ]; + tensorflow-testing = [ + tensorflow + keras + ]; + hf_xet = [ + # hf-xet + ]; + }; + # Tests require network access. doCheck = false;