-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Feat: Support of converting local models added to convert-hf-to-gguf-update.py
#7547
Conversation
Hi! Any news about my PR? People need this simple feature :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can merge after rebasing on latest master
@ggerganov hi! You mean I need to merge |
Yes. The |
Done, i've also tested this new feature by hands, it works fine. |
* Support of converting local models added to convert-hf-to-gguf-update.py * Description fixed * shutil added to imports
* Support of converting local models added to convert-hf-to-gguf-update.py * Description fixed * shutil added to imports
* Support of converting local models added to convert-hf-to-gguf-update.py * Description fixed * shutil added to imports
Description
For one of my projects, I needed to convert a trained BERT model, which was only available on my local filesystem. However, when I attempted the conversion, I encountered an error indicating that my tokenizer was not supported. To resolve this, I added my local model and its filesystem path to the models array, but running the
convert-hf-to-gguf-update.py
script did not updateconvert-hf-to-gguf.py
as expected.The root cause was identified in the
download_model
function. The current implementation only supports downloading models hosted on HuggingFace.But my fix extends this functionality to also support models stored locally.
Changes Made
download_model
function to check if therepo
path is a local directory.repo
is a local path, the function now copies the required files from the local directory to the appropriate destination.repo
is a URL, the function retains its original behavior of downloading the files from HuggingFace.Example Usage
To convert a local model, you can now add it to the models array of
convert-hf-to-gguf-update.py
with the local filesystem path:Run it:
And new block will be added to
convert-hf-to-gguf.py
, it will looks like this:After than you will be able to convert local model to the GGUF format.