From a3ec0938c55c96aa9f243a9efd959d22851b8ad0 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Fri, 29 Mar 2024 17:28:28 +0200 Subject: [PATCH] KoboldCpp grammar fix --- public/scripts/textgen-settings.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/scripts/textgen-settings.js b/public/scripts/textgen-settings.js index 515355e59..fdd2380f7 100644 --- a/public/scripts/textgen-settings.js +++ b/public/scripts/textgen-settings.js @@ -38,7 +38,7 @@ export const textgen_types = { OPENROUTER: 'openrouter', }; -const { MANCER, APHRODITE, TABBY, TOGETHERAI, OOBA, OLLAMA, LLAMACPP, INFERMATICAI, DREAMGEN, OPENROUTER } = textgen_types; +const { MANCER, APHRODITE, TABBY, TOGETHERAI, OOBA, OLLAMA, LLAMACPP, INFERMATICAI, DREAMGEN, OPENROUTER, KOBOLDCPP } = textgen_types; const LLAMACPP_DEFAULT_ORDER = [ 'top_k', @@ -1047,6 +1047,10 @@ export function getTextGenGenerationData(finalPrompt, maxTokens, isImpersonate, //'prompt_logprobs': settings.prompt_log_probs_aphrodite, }; + if (settings.type === KOBOLDCPP) { + params.grammar = settings.grammar_string; + } + if (settings.type === MANCER) { params.n = canMultiSwipe ? settings.n : 1; params.epsilon_cutoff /= 1000;