File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -2215,7 +2215,7 @@ class GenerateResponseState<const Functions extends ChatModelFunctions | undefin
2215
2215
}
2216
2216
2217
2217
public waitOnPartialCharactersOrWhiteSpaceTokens ( ) {
2218
- if ( this . currentText === UNKNOWN_UNICODE_CHAR || (
2218
+ if ( this . currentText . endsWith ( UNKNOWN_UNICODE_CHAR ) || (
2219
2219
( this . grammar ?. trimWhitespaceSuffix || this . trimWhitespaceSuffix ) && this . currentText ?. trim ( ) === ""
2220
2220
) ) {
2221
2221
if ( this . currentQueuedTokenRelease != null )
Original file line number Diff line number Diff line change @@ -662,7 +662,7 @@ export class LlamaCompletion {
662
662
const text = model . detokenize ( [ token ] ) ;
663
663
const queuedTokenRelease = streamRegulator . addChunk ( { tokens, text} ) ;
664
664
665
- if ( text === UNKNOWN_UNICODE_CHAR || (
665
+ if ( text . endsWith ( UNKNOWN_UNICODE_CHAR ) || (
666
666
( grammar ?. trimWhitespaceSuffix || trimWhitespaceSuffix ) && text . trim ( ) === ""
667
667
) ) {
668
668
locksToReleaseOnValidGeneration . push ( queuedTokenRelease . createTextIndexLock ( 0 ) ) ;
You can’t perform that action at this time.
0 commit comments