Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/kwaroran/RisuAI
Browse files Browse the repository at this point in the history
  • Loading branch information
kwaroran committed Dec 17, 2024
2 parents 7c7bf16 + 2225a53 commit 6d3fdad
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion src/ts/process/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,46 @@ function applyParameters(data: { [key: string]: any }, parameters: Parameter[],
}

for(const parameter of parameters){

let value = 0
if(parameter === 'top_k' && arg.ignoreTopKIfZero && db.seperateParameters[ModelMode][parameter] === 0){
continue
}

let value = db.seperateParameters[ModelMode][parameter]
switch(parameter){
case 'temperature':{
value = db.seperateParameters[ModelMode].temperature === -1000 ? -1000 : (db.seperateParameters[ModelMode].temperature / 100)
break
}
case 'top_k':{
value = db.seperateParameters[ModelMode].top_k
break
}
case 'repetition_penalty':{
value = db.seperateParameters[ModelMode].repetition_penalty
break
}
case 'min_p':{
value = db.seperateParameters[ModelMode].min_p
break
}
case 'top_a':{
value = db.seperateParameters[ModelMode].top_a
break
}
case 'top_p':{
value = db.seperateParameters[ModelMode].top_p
break
}
case 'frequency_penalty':{
value = db.seperateParameters[ModelMode].frequency_penalty === -1000 ? -1000 : (db.seperateParameters[ModelMode].frequency_penalty / 100)
break
}
case 'presence_penalty':{
value = db.seperateParameters[ModelMode].presence_penalty === -1000 ? -1000 : (db.seperateParameters[ModelMode].presence_penalty / 100)
break
}
}

if(value === -1000 || value === undefined){
continue
Expand Down

0 comments on commit 6d3fdad

Please sign in to comment.