!rWxyQqNqMUDLECdsIf:blad.is

Poetry2nix

306 Members
https://github.com/nix-community/poetry2nix56 Servers

Load older messages


SenderMessageTime
9 Nov 2023
@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
@matthewcroughan:defenestrate.itmatthewcroughanmaybe the major version has something to do with it 19:43:37
@matthewcroughan:defenestrate.itmatthewcroughannixpkgs, and nixified ai has 0.3.3, whereas what's being asked for is 0.4.0, maybe they did something 19:43:53
@matthewcroughan:defenestrate.itmatthewcroughan
import transformers.models.auto
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/nix/store/qqlksqz6x91k9w4pn8mj2dc2s077zbmd-python3.11-transformers-4.34.0/lib/python3.11/site-packages/transformers/models/__init__.py", line 15, in <module>
    from . import (
  File "/nix/store/qqlksqz6x91k9w4pn8mj2dc2s077zbmd-python3.11-transformers-4.34.0/lib/python3.11/site-packages/transformers/models/mt5/__init__.py", line 29, in <module>
    from ..t5.tokenization_t5 import T5Tokenizer
  File "/nix/store/qqlksqz6x91k9w4pn8mj2dc2s077zbmd-python3.11-transformers-4.34.0/lib/python3.11/site-packages/transformers/models/t5/tokenization_t5.py", line 26, in <module>
    from ...convert_slow_tokenizer import import_protobuf
  File "/nix/store/qqlksqz6x91k9w4pn8mj2dc2s077zbmd-python3.11-transformers-4.34.0/lib/python3.11/site-packages/transformers/convert_slow_tokenizer.py", line 27, in <module>
    from tokenizers.models import BPE, Unigram, WordPiece
ModuleNotFoundError: No module named 'tokenizers.models'
22:56:04
@matthewcroughan:defenestrate.itmatthewcroughanI have not been able to debug why this happens either.22:56:32
@matthewcroughan:defenestrate.itmatthewcroughan I did manage to filter cmake out of the dependency graph by overriding 4 other python deps though, and just replacing it with pkgs.cmake instead of the python built one 22:57:49
@matthewcroughan:defenestrate.itmatthewcroughanThis is what happens after I fix safetensors to be importable23:00:00
@k900:0upti.meK900
In reply to @matthewcroughan:defenestrate.it
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
That module is literally not there
23:01:38
@k900:0upti.meK900Why it's not there, I don't know 23:01:43
@k900:0upti.meK900But it isn't 23:01:45
@matthewcroughan:defenestrate.itmatthewcroughanhttps://huggingface.co/docs/tokenizers/api/models23:03:57
@matthewcroughan:defenestrate.itmatthewcroughanmaybe because it's a wheel?23:05:10
@k900:0upti.meK900Wheels generally don't make modules disappear 23:05:46
@matthewcroughan:defenestrate.itmatthewcroughanhttps://github.com/huggingface/tokenizers/blob/648b33a09ee8da40a5b4599054eb855a7a875ca5/bindings/python/src/models.rs#L84023:12:19
@matthewcroughan:defenestrate.itmatthewcroughanlooks like it's part of the rust code 23:12:39
@matthewcroughan:defenestrate.itmatthewcroughan

During the build log for tokenizers it says

python3.11-tokenizers> ⚠️  Warning: You're building a library without activating pyo3's `extension-module` feature. See https://pyo3.rs/v0.19.2/building_and_distribution.html#linking
python3.11-tokenizers> 🔗 Found pyo3 bindings
python3.11-tokenizers> 🐍 Found CPython 3.11 at /nix/store/ffll6glz3gwx342z0ch8wx30p5cnqz1z-python3-3.11.5/bin/python3
python3.11-tokenizers>    Compiling autocfg v1.1.
23:14:26
@k900:0upti.meK900https://github.com/huggingface/tokenizers/blob/648b33a09ee8da40a5b4599054eb855a7a875ca5/bindings/python/py_src/tokenizers/models/__init__.py23:20:49
@k900:0upti.meK900No it's not23:20:51
@matthewcroughan:defenestrate.itmatthewcroughanthe transformers from nixpkgs can do this import, that is good 23:22:11
@matthewcroughan:defenestrate.itmatthewcroughan K900 ⚡️: I literally copy pasted the derivation form nixpkgs, and made an override like this transformers = super.pythonPackages.callPackage ./f.nix {}; 23:32:45
@matthewcroughan:defenestrate.itmatthewcroughanis that dumb, or a good debugging step?23:33:02
@k900:0upti.meK900Could work23:33:11

Show newer messages


Back to Room ListRoom Version: 6