Skip to content

Implement GGUF metadata KV overrides#1011

Merged
abetlen merged 9 commits intoabetlen:mainfrom
phiharri:kv_overrides
Jan 15, 2024
Merged

Implement GGUF metadata KV overrides#1011
abetlen merged 9 commits intoabetlen:mainfrom
phiharri:kv_overrides

Conversation

@phiharri
Copy link
Copy Markdown
Contributor

@phiharri phiharri commented Dec 14, 2023

Quick implementation of KV overrides which accepts strings in llama.cpp --kv_overrides KEY=TYPE:VALUE .. format. For example llama.expert_used_count=int:3 Multiple overrides may be space separated.

Not that familiar with ctypes or the preferred types to use here.

Closes #1084

@abetlen
Copy link
Copy Markdown
Owner

abetlen commented Jan 14, 2024

Hey @phiharri thanks for the contribution, I have a few changes to make but the overall api seems correct. I think the kv overrides argument to the Llama class should just be a dictionary and the types should be based on the python types but the string based approach for the cli args looks good.

@abetlen
Copy link
Copy Markdown
Owner

abetlen commented Jan 15, 2024

Looks good now, @phiharri thank you for the contribution!

@abetlen abetlen merged commit 76aafa6 into abetlen:main Jan 15, 2024
abetlen pushed a commit that referenced this pull request Jan 24, 2024
* kv overrides another attempt

* add sentinel element, simplify array population

* ensure sentinel element is zeroed
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.

Add KV overrides support to Llama class and server

2 participants