Merge pull request #1734 from khanonnie/alternative-tokens

Implement Token Probabilities UI panel using logprobs
This commit is contained in:
Cohee
2024-01-26 03:39:25 +02:00
committed by GitHub
16 changed files with 921 additions and 35 deletions

View File

@ -354,8 +354,8 @@ function trimTokensCallback(arg, value) {
}
const sliceTokens = direction === 'start' ? textTokens.slice(0, limit) : textTokens.slice(-limit);
const decodedText = decodeTextTokens(tokenizerId, sliceTokens);
return decodedText;
const { text } = decodeTextTokens(tokenizerId, sliceTokens);
return text;
} catch (error) {
console.warn('WARN: Tokenization failed for /trimtokens command, returning original', error);
return value;