Skip to content

WIP: refactoring for GGUF support - #75

Merged
monatis merged 23 commits into
mainfrom
refactor-gguf
Sep 27, 2023
Merged

monatis merged 23 commits into
mainfrom
refactor-gguf

Conversation

@monatis

@monatis monatis commented Sep 21, 2023 •

Copy link
Copy Markdown
Owner

closes #60, #49, #32

This is still WIP and not yet for anything yet.
I hope to finish it by Sunday.

  • Rewrite the conversion script for GGUF support.
  • Output text-only, vision-only and two-tower models according to the CLI argument.
  • Allow overriding mean / std values for image processing.
  • Load GGUF file and infer with it (WIP).
  • Re-implement the quantization function.
  • Support f32, q5_0, q5_1 and q8_0 models in addition to f16, q4_0 and q4_1.
  • Handle memory buffer allocation logic for new text-only and vision-only models.
  • Test and upload different CLIP models in new GGUF format.
  • Update Python bindings.

@monatis
monatis marked this pull request as ready for review September 25, 2023 22:24
@monatis

monatis commented Sep 25, 2023

Copy link
Copy Markdown
Owner Author

I set this ready for review although it will require some tests with different models and fixes in memory allocation for text-only and vision-only model variants.

I'll do tests and make some code polishing over the coming days. Any test and feedback will be much appreciated btw.

@monatis

monatis commented Sep 26, 2023

Copy link
Copy Markdown
Owner Author

I'm preparing the PR for merging later today. Added a shell script for bulk model conversion. Another script will do quantization in bulk. Then uploading models + updating readme and merging.

Python binding will require an update in its automatic model selection as now the smallest model in a repo is a text-only model, but I'll leave it to another PR.

@monatis

monatis commented Sep 27, 2023

Copy link
Copy Markdown
Owner Author

Also updated the Python bindings to work with the new GGUF format and find pre-converted models uploaded to HF.

I think this is good to merge now.

@monatis
monatis merged commit 23fc07b into main Sep 27, 2023
Comment thread README.md Outdated
## Preconverted Models

Preconverted Models can be found in [HuggingFace Repositories tagged with `clip.cpp`](https://huggingface.co/models?other=clip.cpp).
Preconverted Models can be found in [HuggingFace Repositories tagged with `clip.cpp-gguf`](https://huggingface.co/models?other=clip.cpp).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

you sure this is a good idea? i can take down /reupload my repos too.

also, you only changed the text, not the link

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I don't have a strong opinion in this, but I just wanted to close this PR to jump to other tasks (implement BERT and large multimodal models). I only uploaded a few models --my internet speed is not so good. If you'd like to re-upload models I'd only be happy :D and new shell scripts might help you with conversions and quantizations.

@Green-Sky

Copy link
Copy Markdown
Collaborator

file names are somewhat lenghty now, with "ggml-model" "ggml-text-model" and "ggml-vision-model". feels like the "ggml" here is redundant (.gguf).

@monatis

monatis commented Sep 27, 2023

Copy link
Copy Markdown
Owner Author

yes, it might be {full|text|vision}-model-{ftype}.gguf

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.

Migrate to GGUF

2 participants