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

add KV override field for llama.cpp loaders #4925

Open
wants to merge 32 commits into
base: dev
Choose a base branch
from

Conversation

phiharri
Copy link

Adds a new text field for llama.cpp and llamacpp_HF loaders to implement llama.cpp's --override-kv.

depends abetlen/llama-cpp-python#1011

phiharri and others added 24 commits December 14, 2023 21:20
@oobabooga
Copy link
Owner

Does it work with updated llama-cpp-python 0.2.29? Could you merge the dev branch?

@phiharri
Copy link
Author

llama_cpp.Llama now expects a Dict[str,Union[bool,int,float]] for kv_overrides. Wondering if there's a better way in Gradio to accept these params other than string parsing (although that is consistent with llama.cpp CLI).

On looking into this and latest llama-cpp-python changes I see other parameters that may be interesting to include in webui (eg. split_mode to adjust layer allocation with multi GPU).

Perhaps a more generic way to pass in any experimental parameters directly to llama_cpp.Llama constructor (parsing with ast.literal_eval?) would avoid this lengthy process of features needing interface changes in llama.cpp -> llama-cpp-python -> text-generation-webui. Any thoughts?

@araleza
Copy link

araleza commented Feb 10, 2024

This sounds good, it would solve the 'change number of Mixtral experts' issue raised here:

#5367

@phiharri
Copy link
Author

Changed to build a dict from the gradio field so this works with current llama-cpp-python.

@phiharri phiharri marked this pull request as ready for review February 13, 2024 13:22
@oobabooga oobabooga deleted the branch oobabooga:dev February 17, 2024 21:53
@oobabooga oobabooga closed this Feb 17, 2024
@oobabooga oobabooga reopened this Feb 17, 2024
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.

3 participants