[feat] add top_k for openrouter

This commit is contained in:
kwaroran
2024-01-03 19:03:24 +09:00
parent a8e50dcd77
commit 99743f581a
3 changed files with 15 additions and 1 deletions

View File

@@ -313,6 +313,12 @@
{/if}
<span class="text-textcolor2 mb-6 text-sm">{($DataBase.temperature / 100).toFixed(2)}</span>
{#if $DataBase.aiModel.startsWith('openrouter')}
<span class="text-textcolor">Top K</span>
<SliderInput min={0} max={100} step={1} bind:value={$DataBase.top_k}/>
<span class="text-textcolor2 mb-6 text-sm">{($DataBase.top_k).toFixed(0)}</span>
{/if}
{#if $DataBase.aiModel === 'textgen_webui' || $DataBase.aiModel === 'mancer' || $DataBase.aiModel.startsWith('local_')}
<span class="text-textcolor">Repetition Penalty</span>
<SliderInput min={1} max={1.5} step={0.01} bind:value={$DataBase.ooba.repetition_penalty}/>

View File

@@ -422,6 +422,13 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
body.user = getOpenUserString()
}
if(aiModel === 'openrouter'){
if(db.top_k !== 0){
//@ts-ignore
body.top_k = db.top_k
}
}
if(aiModel === 'reverse_proxy' && db.reverseProxyOobaMode){
const OobaBodyTemplate = db.reverseProxyOobaArgs

View File

@@ -581,7 +581,8 @@ export interface Database{
messages: number
chats: number
}
}
},
top_k:number
}
export interface customscript{