[feat] oai seed
This commit is contained in:
@@ -437,4 +437,5 @@ export const languageEnglish = {
|
|||||||
customStopWords: "Custom Stop Words",
|
customStopWords: "Custom Stop Words",
|
||||||
defaultPrompt: "Default Prompt",
|
defaultPrompt: "Default Prompt",
|
||||||
additionalText: 'Additional Description',
|
additionalText: 'Additional Description',
|
||||||
|
seed: "Seed",
|
||||||
}
|
}
|
||||||
@@ -267,6 +267,11 @@
|
|||||||
<span class="text-textcolor">{language.maxResponseSize}</span>
|
<span class="text-textcolor">{language.maxResponseSize}</span>
|
||||||
<NumberInput min={0} max={2048} marginBottom={true} bind:value={$DataBase.maxResponse}/>
|
<NumberInput min={0} max={2048} marginBottom={true} bind:value={$DataBase.maxResponse}/>
|
||||||
|
|
||||||
|
{#if $DataBase.aiModel.startsWith('gpt') || $DataBase.aiModel === 'reverse_proxy' || $DataBase.aiModel === 'openrouter'}
|
||||||
|
<span class="text-textcolor">{language.seed}</span>
|
||||||
|
|
||||||
|
<NumberInput bind:value={$DataBase.generationSeed} marginBottom={true}/>
|
||||||
|
{/if}
|
||||||
<span class="text-textcolor">{language.temperature} <Help key="tempature"/></span>
|
<span class="text-textcolor">{language.temperature} <Help key="tempature"/></span>
|
||||||
|
|
||||||
{#if $DataBase.aiModel.startsWith("novelai")}
|
{#if $DataBase.aiModel.startsWith("novelai")}
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
|||||||
|
|
||||||
|
|
||||||
db.cipherChat = false
|
db.cipherChat = false
|
||||||
const body = ({
|
let body = ({
|
||||||
model: aiModel === 'openrouter' ? db.openrouterRequestModel :
|
model: aiModel === 'openrouter' ? db.openrouterRequestModel :
|
||||||
requestModel === 'gpt35' ? 'gpt-3.5-turbo'
|
requestModel === 'gpt35' ? 'gpt-3.5-turbo'
|
||||||
: requestModel === 'gpt35_0613' ? 'gpt-3.5-turbo-0613'
|
: requestModel === 'gpt35_0613' ? 'gpt-3.5-turbo-0613'
|
||||||
@@ -205,9 +205,14 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
|||||||
presence_penalty: arg.PresensePenalty || (db.PresensePenalty / 100),
|
presence_penalty: arg.PresensePenalty || (db.PresensePenalty / 100),
|
||||||
frequency_penalty: arg.frequencyPenalty || (db.frequencyPenalty / 100),
|
frequency_penalty: arg.frequencyPenalty || (db.frequencyPenalty / 100),
|
||||||
logit_bias: bias,
|
logit_bias: bias,
|
||||||
stream: false
|
stream: false,
|
||||||
|
seed: db.generationSeed
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if(body.seed === -1){
|
||||||
|
delete body.seed
|
||||||
|
}
|
||||||
|
|
||||||
let replacerURL = aiModel === 'openrouter' ? "https://openrouter.ai/api/v1/chat/completions" :
|
let replacerURL = aiModel === 'openrouter' ? "https://openrouter.ai/api/v1/chat/completions" :
|
||||||
(aiModel === 'reverse_proxy') ? (db.forceReplaceUrl) : ('https://api.openai.com/v1/chat/completions')
|
(aiModel === 'reverse_proxy') ? (db.forceReplaceUrl) : ('https://api.openai.com/v1/chat/completions')
|
||||||
|
|
||||||
|
|||||||
@@ -317,6 +317,7 @@ export function setDatabase(data:Database){
|
|||||||
data.NAIsettings.mirostat_lr ??= 1
|
data.NAIsettings.mirostat_lr ??= 1
|
||||||
data.autofillRequestUrl ??= true
|
data.autofillRequestUrl ??= true
|
||||||
data.customProxyRequestModel ??= ''
|
data.customProxyRequestModel ??= ''
|
||||||
|
data.generationSeed ??= -1
|
||||||
changeLanguage(data.language)
|
changeLanguage(data.language)
|
||||||
DataBase.set(data)
|
DataBase.set(data)
|
||||||
}
|
}
|
||||||
@@ -489,6 +490,7 @@ export interface Database{
|
|||||||
localStopStrings?:string[]
|
localStopStrings?:string[]
|
||||||
autofillRequestUrl:boolean
|
autofillRequestUrl:boolean
|
||||||
customProxyRequestModel:string
|
customProxyRequestModel:string
|
||||||
|
generationSeed:number
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface customscript{
|
export interface customscript{
|
||||||
|
|||||||
Reference in New Issue
Block a user