mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 17:14:36 +00:00
add premade chat completions adapter
This commit is contained in:
parent
f3dfa96dbc
commit
73b99a7266
2 changed files with 17 additions and 2 deletions
8
kcpp_adapters/llama3.json
Normal file
8
kcpp_adapters/llama3.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"system_start":"<|start_header_id|>system<|end_header_id|>\n\n",
|
||||
"system_end":"<|eot_id|>",
|
||||
"user_start":"<|eot_id|><|start_header_id|>user<|end_header_id|>\n\n",
|
||||
"user_end":"<|eot_id|>",
|
||||
"assistant_start":"<|start_header_id|>assistant<|end_header_id|>\n\n",
|
||||
"assistant_end":"<|eot_id|>"
|
||||
}
|
11
koboldcpp.py
11
koboldcpp.py
|
@ -597,7 +597,7 @@ def sd_generate(genparams):
|
|||
negative_prompt = genparams.get("negative_prompt", "")
|
||||
if forced_negprompt!="":
|
||||
if negative_prompt!="":
|
||||
negative_prompt += " " + forced_negprompt
|
||||
negative_prompt += ", " + forced_negprompt
|
||||
else:
|
||||
negative_prompt = forced_negprompt
|
||||
init_images_arr = genparams.get("init_images", [])
|
||||
|
@ -2338,7 +2338,14 @@ def show_new_gui():
|
|||
noqkvlabel = makelabel(tokens_tab,"Requirments Not Met",31,0,"Requires FlashAttention ENABLED and ContextShift DISABLED.")
|
||||
noqkvlabel.configure(text_color="#ff5555")
|
||||
qkvslider,qkvlabel,qkvtitle = makeslider(tokens_tab, "Quantize KV Cache:", quantkv_text, quantkv_var, 0, 2, 30, set=0,tooltip="Enable quantization of KV cache.\nRequires FlashAttention and disables ContextShift.")
|
||||
makefileentry(tokens_tab, "ChatCompletions Adapter:", "Select ChatCompletions Adapter File", chatcompletionsadapter_var, 32,tooltiptxt="Select an optional ChatCompletions Adapter JSON file to force custom instruct tags.")
|
||||
makefileentry(tokens_tab, "ChatCompletions Adapter:", "Select ChatCompletions Adapter File", chatcompletionsadapter_var, 32, filetypes=[("JSON Adapter", "*.json")], tooltiptxt="Select an optional ChatCompletions Adapter JSON file to force custom instruct tags.")
|
||||
def pickpremadetemplate():
|
||||
initialDir = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'kcpp_adapters')
|
||||
initialDir = initialDir if os.path.isdir(initialDir) else None
|
||||
fnam = askopenfilename(title="Pick Premade ChatCompletions Adapter",filetypes=[("JSON Adapter", "*.json")], initialdir=initialDir)
|
||||
if fnam:
|
||||
chatcompletionsadapter_var.set(fnam)
|
||||
ctk.CTkButton(tokens_tab, 64, text="Pick Premade", command=pickpremadetemplate).grid(row=33, column=1, padx=62, stick="nw")
|
||||
togglerope(1,1,1)
|
||||
toggleflashattn(1,1,1)
|
||||
togglectxshift(1,1,1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue