CoolFace
Modelpublic

Codeprocastinator/optimized-tinyllama-covalent

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes119downloads
README.md93 linesDownload Raw Back to gguf-py
1## gguf2 3This is a Python package for writing binary files in the [GGUF](https://github.com/ggml-org/ggml/pull/302)4(GGML Universal File) format.5 6See [convert_hf_to_gguf.py](https://github.com/ggml-org/llama.cpp/blob/master/convert_hf_to_gguf.py)7as an example for its usage.8 9## Installation10```sh11pip install gguf12```13 14## API Examples/Simple Tools15 16[examples/writer.py](https://github.com/ggml-org/llama.cpp/blob/master/gguf-py/examples/writer.py) — Generates `example.gguf` in the current directory to demonstrate generating a GGUF file. Note that this file cannot be used as a model.17 18[examples/reader.py](https://github.com/ggml-org/llama.cpp/blob/master/gguf-py/examples/reader.py) — Extracts and displays key-value pairs and tensor details from a GGUF file in a readable format.19 20[gguf/scripts/gguf_dump.py](https://github.com/ggml-org/llama.cpp/blob/master/gguf-py/gguf/scripts/gguf_dump.py) — Dumps a GGUF file's metadata to the console.21 22[gguf/scripts/gguf_set_metadata.py](https://github.com/ggml-org/llama.cpp/blob/master/gguf-py/gguf/scripts/gguf_set_metadata.py) — Allows changing simple metadata values in a GGUF file by key.23 24[gguf/scripts/gguf_convert_endian.py](https://github.com/ggml-org/llama.cpp/blob/master/gguf-py/gguf/scripts/gguf_convert_endian.py) — Allows converting the endianness of GGUF files.25 26[gguf/scripts/gguf_new_metadata.py](https://github.com/ggml-org/llama.cpp/blob/master/gguf-py/gguf/scripts/gguf_new_metadata.py) — Copies a GGUF file with added/modified/removed metadata values.27 28## Development29Maintainers who participate in development of this package are advised to install it in editable mode:30 31```sh32cd /path/to/llama.cpp/gguf-py33 34pip install --editable .35```36 37**Note**: This may require to upgrade your Pip installation, with a message saying that editable installation currently requires `setup.py`.38In this case, upgrade Pip to the latest:39 40```sh41pip install --upgrade pip42```43 44## Automatic publishing with CI45 46There's a GitHub workflow to make a release automatically upon creation of tags in a specified format.47 481. Bump the version in `pyproject.toml`.492. Create a tag named `gguf-vx.x.x` where `x.x.x` is the semantic version number.50 51```sh52git tag -a gguf-v1.0.0 -m "Version 1.0 release"53```54 553. Push the tags.56 57```sh58git push origin --tags59```60 61## Manual publishing62If you want to publish the package manually for any reason, you need to have `twine` and `build` installed:63 64```sh65pip install build twine66```67 68Then, follow these steps to release a new version:69 701. Bump the version in `pyproject.toml`.712. Build the package:72 73```sh74python -m build75```76 773. Upload the generated distribution archives:78 79```sh80python -m twine upload dist/*81```82 83## Run Unit Tests84 85From root of this repository you can run this command to run all the unit tests86 87```bash88python -m unittest discover ./gguf-py -v89```90 91## TODO92- [ ] Include conversion scripts as command line entry points in this package.93