-
Notifications
You must be signed in to change notification settings - Fork 11.9k
gguf-py : avoid requiring PySide6 for packaged scripts #13036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gguf-py : avoid requiring PySide6 for packaged scripts #13036
Conversation
Interesting, so this is clearly a problem with the way the entrypoints are all made from the same
Hmmm, yeah, let's hope so. |
So, to answer my own question, I just tried emptying [tool.poetry.scripts]
gguf-convert-endian = "gguf.scripts.gguf_convert_endian:main"
gguf-dump = "gguf.scripts.gguf_dump:main"
gguf-set-metadata = "gguf.scripts.gguf_set_metadata:main"
gguf-new-metadata = "gguf.scripts.gguf_new_metadata:main"
gguf-editor-gui = "gguf.scripts.gguf_editor_gui:main" Built and installed the package and problem seems to be solved, know why it wasn't done like this to begin with? |
@compilade Looking at the commit history I think it sort of just evolved into this without any serious consideration as to why, I think clearing Let me know if you need me to tag the release later. |
@CISC I went ahead and changed I've tested the scripts after building, and they work fine even when |
@compilade Any reason for not merging yet? If nix/flake changes are a concern they can be left out for now, ref #13005 (comment) |
- gguf-py : remove gguf-py/gguf/scripts/__init__.py because it's not needed Implicit namespaces are supported since Python 3.3 (https://peps.python.org/pep-0420/), and the entrypoints in pyproject.toml can directly refer to the main functions.
7aef532
to
a994bda
Compare
Not really, sorry (I got distracted).
I've been wanting to try importing the Okay, I've reverted the changes to the flake. So the only changes included are now only for fixing #13054. And you've already seen the changes kept here (since I did not change that further (I'm strictly changing fewer things)), so I will merge this now. |
* origin/master: (27 commits) llama : fix build_ffn without gate (ggml-org#13336) CUDA: fix bad asserts for partial offload (ggml-org#13337) convert : qwen2/3moe : set yarn metadata if present (ggml-org#13331) CUDA: fix --split-mode row for MMQ (ggml-org#13323) gguf-py : avoid requiring pyside6 for other scripts (ggml-org#13036) CUDA: fix logic for clearing padding with -ngl 0 (ggml-org#13320) sampling : Integrate Top-nσ into main sampling chain (and add it to the server) (ggml-org#13264) server : Webui - change setText command from parent window to also send the message. (ggml-org#13309) mtmd : rename llava directory to mtmd (ggml-org#13311) clip : fix confused naming ffn_up and ffn_down (ggml-org#13290) convert : bailingmoe : set yarn metadata if present (ggml-org#13312) SYCL: Disable mul_mat kernels for noncontiguous tensor b (ggml-org#13308) mtmd : add C public API (ggml-org#13184) rpc : use backend registry, support dl backends (ggml-org#13304) ggml : activate s390x simd for Q3_K (ggml-org#13301) llava/mtmd : fixes to fully support dl backends (ggml-org#13303) llama : build windows releases with dl backends (ggml-org#13220) CUDA: fix race condition in MMQ stream-k fixup (ggml-org#13299) CUDA: fix race condition in MMQ ids_dst (ggml-org#13294) vulkan: Additional type support for unary, binary, and copy (ggml-org#13266) ...
Please don't remove it. It contains exact hashes of nixpkgs and other repos that should be confirmed to work. They don't really need to be updated regularly if you don't want to. Users of flake can easily override it, so there are no downsides of having it. But the downside of removing it is that you can't know which version of nixpkgs can build it, and nixpkgs quite regularly have breaking changes. For instance, it can't be build with the latest unstable nixpkgs without couple of small fixes because of the rocm stack update. |
I'm using Nix devShells for my development, most often with
nix develop .#default-extra
.Problem
I wanted to use
gguf-dump
with some model using the wrapper which that devShell puts in the$PATH
, and was greeted withThat should not be a fatal error, since
gguf-dump
doesn't require that module.This is a problem likely introduced in #12930.
Note that this problem also happens when using
pip install gguf
in a venv.Changes
gguf-py/gguf/scripts/__init__.py
and directly refer to themain
functions of the scripts as their entrypoint inpyproject.toml
(as suggested in gguf-py : avoid requiring PySide6 for packaged scripts #13036 (comment))__init__.py
can be safely removed from that directory since https://peps.python.org/pep-0420/ (Python 3.3). (and it's not really imported anywhere anymore anyway)Addpyside6
to the python dependencies included in*-extra
devShellsIts transitive dependencies are quite big, though (300 MB compressed). Hopefully that is fine with others who use the*-extra
devShellsUpdate flake.lockBecause the version which is used bygguf_editor_gui
is^6.9
, and6.9.0
is relatively recent (and not in the previous version of nixpkgs inflake.lock
)Make sure to read the contributing guidelines before submitting a PR