scope.nix 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. {
  2. lib,
  3. newScope,
  4. python3,
  5. llamaVersion ? "0.0.0",
  6. }:
  7. let
  8. pythonPackages = python3.pkgs;
  9. buildPythonPackage = pythonPackages.buildPythonPackage;
  10. numpy = pythonPackages.numpy;
  11. tqdm = pythonPackages.tqdm;
  12. sentencepiece = pythonPackages.sentencepiece;
  13. pyyaml = pythonPackages.pyyaml;
  14. poetry-core = pythonPackages.poetry-core;
  15. pytestCheckHook = pythonPackages.pytestCheckHook;
  16. in
  17. # We're using `makeScope` instead of just writing out an attrset
  18. # because it allows users to apply overlays later using `overrideScope'`.
  19. # Cf. https://noogle.dev/f/lib/makeScope
  20. lib.makeScope newScope (self: {
  21. inherit llamaVersion;
  22. gguf-py = self.callPackage ./package-gguf-py.nix {
  23. inherit
  24. buildPythonPackage
  25. numpy
  26. tqdm
  27. sentencepiece
  28. poetry-core
  29. pyyaml
  30. pytestCheckHook
  31. ;
  32. };
  33. python-scripts = self.callPackage ./python-scripts.nix { inherit buildPythonPackage poetry-core; };
  34. llama-cpp = self.callPackage ./package.nix { };
  35. docker = self.callPackage ./docker.nix { };
  36. docker-min = self.callPackage ./docker.nix { interactive = false; };
  37. sif = self.callPackage ./sif.nix { };
  38. })