diff options
author | Ben Sima <ben@bsima.me> | 2025-02-04 21:18:03 -0500 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2025-02-04 21:18:03 -0500 |
commit | 9f5b334eb6d0f64460f14d76255b096777a46332 (patch) | |
tree | db357ca2a933456e1f35c17a1c85000fb5a64b9d /Omni/Bild/Python.nix | |
parent | 86ea51353c223cdc82cb8ebd013d58d70a7e646a (diff) |
Update ollama, llm-ollama, openai-python, llm
I couldn't use llm-ollama because it required some package upgrades, so I
started going down that rabbit hole and ended up 1) realizing that these
packages are way out of date now, and 2) fiddling with overrides to get
everything to work. I finally figured it out, the `postPatch` in ollama-python
was throwing me off for like half a day.
Anyway, one thing to note is that these are changing fast and I need to either
move onto nixpkgs unstable for python stuff, or maintain my own builds of all of
these. Not sure which is more appropriate right now.
Oh and I had to fixup some logging stuff in Biz/Storybook.py because ruff
started complaining about something, which is weird because I don't think the
version changed? But it was easy enough to change.
Diffstat (limited to 'Omni/Bild/Python.nix')
-rw-r--r-- | Omni/Bild/Python.nix | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/Omni/Bild/Python.nix b/Omni/Bild/Python.nix index 035b11c..36abe25 100644 --- a/Omni/Bild/Python.nix +++ b/Omni/Bild/Python.nix @@ -1,13 +1,28 @@ _self: super: { python312 = super.python312.override { - packageOverrides = _pyself: pysuper: + packageOverrides = pyself: pysuper: with pysuper.pkgs.python312Packages; let dontCheck = p: p.overridePythonAttrs (_: {doCheck = false;}); in { interegular = callPackage ./Deps/interegular.nix {}; ipython = dontCheck pysuper.ipython; + llm = super.overrideSrc pysuper.llm super.sources.llm; + llm-ollama = pysuper.pkgs.python312.pkgs.callPackage ./Deps/llm-ollama.nix { + ollama = pyself.ollama; + }; + llm-sentence-transformers = callPackage ./Deps/llm-sentence-transformers.nix {}; ludic = callPackage ./Deps/ludic.nix {}; mypy = dontCheck pysuper.mypy; + ollama = pysuper.ollama.overridePythonAttrs (old: rec { + dependencies = old.dependencies ++ [pysuper.pydantic]; + version = super.sources.ollama-python.version; + src = super.sources.ollama-python; + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail "0.0.0" "${version}" + ''; + }); + openai = callPackage ./Deps/openai-python.nix {}; outlines = callPackage ./Deps/outlines.nix {}; perscache = callPackage ./Deps/perscache.nix {}; tokenizers = dontCheck pysuper.tokenizers; |