Add padding to cache key. Fix Safari display issues. Fix 400 on empty translate. Reset bias cache on changing model.

This commit is contained in:
Cohee
2023-08-23 10:32:48 +03:00
parent b385bd190a
commit e77da62b85
7 changed files with 35 additions and 20 deletions

View File

@ -1647,6 +1647,11 @@ class ChatCompletion {
const index = this.findMessageIndex(identifier);
const message = this.messages.collection[index].collection.pop();
if (!message) {
this.log(`No message to remove from ${identifier}`);
return;
}
this.increaseTokenBudgetBy(message.getTokens());
this.log(`Removed ${message.identifier} from ${identifier}. Remaining tokens: ${this.tokenBudget}`);
@ -2542,6 +2547,7 @@ function getMaxContextWindowAI(value) {
}
async function onModelChange() {
biasCache = undefined;
let value = String($(this).val());
if ($(this).is('#model_claude_select')) {