!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

303 Members
https://github.com/nix-community/poetry2nix54 Servers

Load older messages


SenderMessageTime
9 Nov 2023
@matthewcroughan:defenestrate.itmatthewcroughan
                safetensors = super.safetensors.overridePythonAttrs
                  (
                    old: {
                      sourceRoot = "safetensors-0.4.0/bindings/python";
                      cargoDeps = pkgs.rustPlatform.importCargoLock {
                        lockFile = ./nix/safetensors/Cargo.lock;
                      };
                      nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
                        pkgs.rustPlatform.cargoSetupHook
                        pkgs.rustPlatform.maturinBuildHook
                      ];
                    }
                  );

19:21:54
@k900:0upti.meK900It doesn't have "no metadata"19:21:58
@k900:0upti.meK900 It's missing something 19:22:06
@matthewcroughan:defenestrate.itmatthewcroughanOh, it can't find the package 19:22:17
@matthewcroughan:defenestrate.itmatthewcroughan * Oh, it can't find the package?19:22:19
@k900:0upti.meK900 You can try calling importlib.metadata.version("safetensors") in a Python shell yourself 19:22:20
@matthewcroughan:defenestrate.itmatthewcroughan PackageNotFoundError 19:22:23
@k900:0upti.meK900And see why it fails19:22:24
@matthewcroughan:defenestrate.itmatthewcroughan
ls result/lib/python3.11/site-packages/safetensors_
safetensors_python-0.4.0.dist-info/ safetensors_rust/      
19:24:05
@matthewcroughan:defenestrate.itmatthewcroughangrrr19:24:21
@matthewcroughan:defenestrate.itmatthewcroughanit's not ending up in the site-packages 19:24:26
@matthewcroughan:defenestrate.itmatthewcroughanbut the dist-info is 19:24:44
@k900:0upti.meK900 The dist-info is for safetensors_python 19:25:56
@k900:0upti.meK900 But the package it's looking for is safetensors 19:26:04
@k900:0upti.meK900Have fun19:26:07
@matthewcroughan:defenestrate.itmatthewcroughansafetensors definitely gets built as part of building this application, I'm not sure why it doesn't end up in site-packages19:26:52
@matthewcroughan:defenestrate.itmatthewcroughanis it because the package is misnamed as safetensors_rust ?19:28:41
@matthewcroughan:defenestrate.itmatthewcroughan
result/lib/python3.11/site-packages/safetensors_rust:
__init__.py  __pycache__  safetensors_rust.cpython-311-x86_64-linux-gnu.so
19:28:48
@k900:0upti.meK900I don't know19:29:21
@matthewcroughan:defenestrate.itmatthewcroughanhmm nope, tokenizers is a rust binding that is built in the same way, and it is correctly positioned 19:29:32
@matthewcroughan:defenestrate.itmatthewcroughan
ls result/lib/python3.11/site-packages/tokenizers
tokenizers/                         tokenizers_python-0.14.1.dist-info/ 

user: matthew 🌐 swordfish in privateGPT on  main [!?⇡] is 📦 v0.1.0 via 🐍 
✦ ❯ ls result/lib/python3.11/site-packages/tokenizers
__init__.py  __pycache__  tokenizers.cpython-311-x86_64-linux-gnu.so
19:29:40
@k900:0upti.meK900Python package names and module names are not actually required to match19:29:43
@k900:0upti.meK900 As in, a package named safetensors_python can contain modules named safetensors, safetensors_rust or potato 19:30:08
@matthewcroughan:defenestrate.itmatthewcroughan
import safetensors_rust
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/nix/store/fbdk8grc3nipn0z5prsfcmvd74pvppaf-python3-3.11.5-env/lib/python3.11/site-packages/safetensors_rust/__init__.py", line 1, in <module>
    from .safetensors_rust import *
ImportError: dynamic module does not define module export function (PyInit_safetensors_rust)
19:39:54
@matthewcroughan:defenestrate.itmatthewcroughandoes this tell us anything?19:39:57
@matthewcroughan:defenestrate.itmatthewcroughanI have no idea how the python binding stuff works19:40:28
@k900:0upti.meK900It probably tells you the library is very fucked19:42:19
@matthewcroughan:defenestrate.itmatthewcroughanit seems to compile just fine, and the logs look very similar to transformers which does work correctly19:42:34
@matthewcroughan:defenestrate.itmatthewcroughan * it seems to compile just fine, and the logs look very similar to transformers which does work correctly and builds in the same way 19:42:38
@matthewcroughan:defenestrate.itmatthewcroughanhttps://github.com/nixified-ai/flake/blob/master/packages/safetensors/default.nix19:43:13

Show newer messages


Back to Room ListRoom Version: 6