Skip to content
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: moved scripts directory #11116

Merged
merged 6 commits into from
Jan 8, 2025
Merged

Conversation

VJHack
Copy link
Contributor

@VJHack VJHack commented Jan 7, 2025

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
Copy link
Contributor Author

VJHack commented Jan 8, 2025

@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
Copy link
Contributor Author

VJHack commented Jan 8, 2025

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

@ggerganov ggerganov merged commit 8a1d9c2 into ggerganov:master Jan 8, 2025
4 checks passed
@LostRuins
Copy link
Collaborator

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

For example

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

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
Copy link
Contributor Author

VJHack commented Jan 9, 2025

@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!

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
3 participants