Skip to content

gguf-py: moved scripts directory - #11116

Merged
ggerganov merged 6 commits into
ggml-org:masterfrom
VJHack:pypi-scripts
Jan 8, 2025
Merged

ggerganov merged 6 commits into
ggml-org:masterfrom
VJHack:pypi-scripts

Conversation

@VJHack

@VJHack VJHack commented Jan 7, 2025

Copy link
Copy Markdown
Contributor

When installing the gguf pypi package, only one root level package should be registered. Currently two seprate packages get registered (scripts and gguf) which can cause issues when your project already has a scripts folder.

This PR moves the scripts directory inside the gguf package, making it a subpackage of gguf.

gguf-py
├── LICENSE
├── README.md
├── examples
│   ├── reader.py
│   └── writer.py
├── gguf
│   ├── __init__.py
│   ├── constants.py
│   ├── gguf.py
│   ├── gguf_reader.py
│   ├── gguf_writer.py
│   ├── lazy.py
│   ├── metadata.py
│   ├── py.typed
│   ├── quants.py
│   ├── scripts
│   │   ├── __init__.py
│   │   ├── gguf_convert_endian.py
│   │   ├── gguf_dump.py
│   │   ├── gguf_hash.py
│   │   ├── gguf_new_metadata.py
│   │   └── gguf_set_metadata.py
│   ├── tensor_mapping.py
│   ├── utility.py
│   └── vocab.py
├── poetry.lock
├── pyproject.toml
└── tests
    ├── __init__.py
    ├── test_metadata.py
    └── test_quants.py

Fixes #11089 and Fixes #9566

@github-actions github-actions Bot added the python python script changes label Jan 7, 2025
@VJHack

VJHack commented Jan 8, 2025 •

Copy link
Copy Markdown
Contributor Author

@ggerganov Pyright checks are failing in all pipelines because safetensors released version 0.5.1 to PyPi with a bug a few hours ago. Waiting on this fix to get merged and published.

If there's too much delay, we can pin the package to 0.5.0.

@VJHack

VJHack commented Jan 8, 2025

Copy link
Copy Markdown
Contributor Author

safetensor version 0.5.2 was just released. That fixed the issue.

@ggerganov
ggerganov merged commit 8a1d9c2 into ggml-org:master Jan 8, 2025
@LostRuins

Copy link
Copy Markdown
Collaborator

I think this commit broke the local detection of gguf library for non-installed setups

For example
https://github.com/ggerganov/llama.cpp/blob/8a1d9c25fafbaf4182dd0b785dd6303ee40d55bc/gguf-py/gguf/scripts/gguf_dump.py#L15-L16

should be instead:

if "NO_LOCAL_GGUF" not in os.environ and (Path(__file__).parent.parent.parent.parent / 'gguf-py').exists():
    sys.path.insert(0, str(Path(__file__).parent.parent.parent))

This will need to be changed in 7 other files.

@VJHack

VJHack commented Jan 9, 2025 •

Copy link
Copy Markdown
Contributor Author

@LostRuins I'm seeing several places where this needs to be updated. Will push the fix as soon as possible. Thanks for pointing that out!

arthw pushed a commit to arthw/llama.cpp that referenced this pull request Feb 26, 2025
* Moved scripts dir and fixed pyproject.toml

* updated readme

* fixed README urls

* bump pypi gguf to v0.14.0

* retrigger ci

* empty commit - trigger ci
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
* Moved scripts dir and fixed pyproject.toml

* updated readme

* fixed README urls

* bump pypi gguf to v0.14.0

* retrigger ci

* empty commit - trigger ci
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
* Moved scripts dir and fixed pyproject.toml

* updated readme

* fixed README urls

* bump pypi gguf to v0.14.0

* retrigger ci

* empty commit - trigger ci
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
* Moved scripts dir and fixed pyproject.toml

* updated readme

* fixed README urls

* bump pypi gguf to v0.14.0

* retrigger ci

* empty commit - trigger ci
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
* Moved scripts dir and fixed pyproject.toml

* updated readme

* fixed README urls

* bump pypi gguf to v0.14.0

* retrigger ci

* empty commit - trigger ci
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
* Moved scripts dir and fixed pyproject.toml

* updated readme

* fixed README urls

* bump pypi gguf to v0.14.0

* retrigger ci

* empty commit - trigger ci
fukuro-kun pushed a commit to fukuro-kun/fukuro-llama-cpp-turboquant that referenced this pull request Jul 5, 2026
* Moved scripts dir and fixed pyproject.toml

* updated readme

* fixed README urls

* bump pypi gguf to v0.14.0

* retrigger ci

* empty commit - trigger ci
zommiommy pushed a commit to zommiommy/llama.cpp that referenced this pull request Aug 18, 2026
* Moved scripts dir and fixed pyproject.toml

* updated readme

* fixed README urls

* bump pypi gguf to v0.14.0

* retrigger ci

* empty commit - trigger ci
frostyautumnleaf pushed a commit to frostyautumnleaf/llama.cpp that referenced this pull request Oct 5, 2026
* Moved scripts dir and fixed pyproject.toml

* updated readme

* fixed README urls

* bump pypi gguf to v0.14.0

* retrigger ci

* empty commit - trigger ci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python python script changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misc. bug: gguf pypy package dumps /scripts/ and /examples/ into site-packages Bug: gguf pypi package corrupts environment

3 participants