build(nix): Exclude gguf-py from devShells

This commit is contained in:
ditsuke 2024-02-23 15:12:13 +05:30
parent f363d308a4
commit 0b8ddf8694
No known key found for this signature in database
GPG key ID: 71B6C31C8A5A9D21

View file

@ -72,6 +72,7 @@ let
) ", accelerated with ${strings.concatStringsSep ", " suffices}"; ) ", accelerated with ${strings.concatStringsSep ", " suffices}";
executableSuffix = effectiveStdenv.hostPlatform.extensions.executable; executableSuffix = effectiveStdenv.hostPlatform.extensions.executable;
mapToPythonPackages = ps: packages: map (package: ps.${package}) packages;
# TODO: package the Python in this repository in a Nix-like way. # TODO: package the Python in this repository in a Nix-like way.
# It'd be nice to migrate to buildPythonPackage, as well as ensure this repo # It'd be nice to migrate to buildPythonPackage, as well as ensure this repo
@ -266,7 +267,10 @@ effectiveStdenv.mkDerivation (finalAttrs: {
shell = mkShell { shell = mkShell {
name = "shell-${finalAttrs.finalPackage.name}"; name = "shell-${finalAttrs.finalPackage.name}";
description = "contains numpy and sentencepiece"; description = "contains numpy and sentencepiece";
buildInputs = [ llama-python ]; buildInputs = [
python3.withPackages
(ps: mapToPythonPackages ps llama-python-base-deps)
];
inputsFrom = [ finalAttrs.finalPackage ]; inputsFrom = [ finalAttrs.finalPackage ];
shellHook = '' shellHook = ''
addToSearchPath "LD_LIBRARY_PATH" "${lib.getLib effectiveStdenv.cc.cc}/lib" addToSearchPath "LD_LIBRARY_PATH" "${lib.getLib effectiveStdenv.cc.cc}/lib"
@ -276,7 +280,10 @@ effectiveStdenv.mkDerivation (finalAttrs: {
shell-extra = mkShell { shell-extra = mkShell {
name = "shell-extra-${finalAttrs.finalPackage.name}"; name = "shell-extra-${finalAttrs.finalPackage.name}";
description = "contains numpy, sentencepiece, torchWithoutCuda, and transformers"; description = "contains numpy, sentencepiece, torchWithoutCuda, and transformers";
buildInputs = [ llama-python-extra ]; buildInputs = [
python3.withPackages
(ps: mapToPythonPackages ps llama-python-full-deps)
];
inputsFrom = [ finalAttrs.finalPackage ]; inputsFrom = [ finalAttrs.finalPackage ];
}; };
}; };