text-generation-webui icon indicating copy to clipboard operation
text-generation-webui copied to clipboard

add KV override field for llama.cpp loaders

Open phiharri opened this issue 1 year ago • 4 comments

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 avatar Dec 14 '23 21:12 phiharri

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

oobabooga avatar Jan 18 '24 17:01 oobabooga

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?

phiharri avatar Jan 20 '24 14:01 phiharri

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

https://github.com/oobabooga/text-generation-webui/discussions/5367

araleza avatar Feb 10 '24 13:02 araleza

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

phiharri avatar Feb 13 '24 13:02 phiharri