Skip to content

Publish gguf as a Pip package - #2759

Merged
monatis merged 10 commits into
masterfrom
gguf-pip
Aug 25, 2023
Merged

monatis merged 10 commits into
masterfrom
gguf-pip

Conversation

@monatis

@monatis monatis commented Aug 24, 2023 •

Copy link
Copy Markdown
Collaborator

Closes #2702

This PR prepares GGUF as a Pip-installable package so that anyone can use it outside this repo as well.

https://pypi.org/project/gguf/

Developers should install it in editable mode with:

cd gguf-py
pip install --editable .
  • I can add collaborators to the Pypi project upon request.
  • My plan is gradually move conversion scripts to this package as command line entry points.
  • In the future, it can be moved to its own repo with a collection of numerous conversion scripts, but it's currently fine to keep it in this repo for faster development.

@ggerganov

Copy link
Copy Markdown
Member

Is there a way to make the convert scripts currently in the root of the repo to directly "see" the gguf-py code without having to install the pip dependency? Otherwise I think one would need to make a new version of the package for each change they would like to test. Or is this something that pip install --editable . fixes?

@monatis

monatis commented Aug 25, 2023

Copy link
Copy Markdown
Collaborator Author

@ggerganov yes, with pip install --editable . any change in this repo will be instantly effective for conversion scripts as well --no need to re-install it during development.

@ggerganov ggerganov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok - let's merge when you think it is ready

@monatis

monatis commented Aug 25, 2023

Copy link
Copy Markdown
Collaborator Author

Thanks --let's merge it as is --I'll add CI workflow for auto releases in an upcoming release

It'll require a secret in the repo, so I'll make sure that it's working before adding it.

@monatis
monatis merged commit 87e3733 into master Aug 25, 2023
@ggerganov

Copy link
Copy Markdown
Member

Hm, something is not right. I get the following error:

 $ ▶ python3 convert.py 
Traceback (most recent call last):
  File "/Users/ggerganov/development/github/llama.cpp/convert.py", line 37, in <module>
    ARCH=gguf.MODEL_ARCH.LLAMA
         ^^^^^^^^^^^^^^^
AttributeError: module 'gguf' has no attribute 'MODEL_ARCH'

Maybe the package does not export the enums ?

@monatis

monatis commented Aug 25, 2023 •

Copy link
Copy Markdown
Collaborator Author

@slaren

slaren commented Aug 30, 2023

Copy link
Copy Markdown
Member

Would it be possible to add a symlink to gguf.py in the root directory of the repository to avoid having to install the pip package?

@monatis

monatis commented Aug 30, 2023

Copy link
Copy Markdown
Collaborator Author

Symlinking to gguf-py/gguf/gguf.py should work, but it's a little bit hacky. Is there a specific reason to not install it?

@slaren

slaren commented Aug 30, 2023 •

Copy link
Copy Markdown
Member

Is there a specific reason to not install it?

Just to make convert.py easier to use. Currently, users have to install a pip package to convert the models, if that extra step could be avoided it would be good in my opinion. There is also the issue of users failing to install it in-place and then using an outdated version of gguf.py.

@monatis

monatis commented Aug 30, 2023

Copy link
Copy Markdown
Collaborator Author

Installing a small Pip package should not be too hard --it's already in requirements.txt. Usage of an outdated version might be a problem that results in more issues raised, but we need to also test the compatibility of symlinking workaround across different platforms --it might bring more headache than real benefit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plans to publish gguf as a pip package?

3 participants