File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2215,7 +2215,7 @@ class GenerateResponseState<const Functions extends ChatModelFunctions | undefin
22152215 }
22162216
22172217 public waitOnPartialCharactersOrWhiteSpaceTokens ( ) {
2218- if ( this . currentText === UNKNOWN_UNICODE_CHAR || (
2218+ if ( this . currentText . endsWith ( UNKNOWN_UNICODE_CHAR ) || (
22192219 ( this . grammar ?. trimWhitespaceSuffix || this . trimWhitespaceSuffix ) && this . currentText ?. trim ( ) === ""
22202220 ) ) {
22212221 if ( this . currentQueuedTokenRelease != null )
Original file line number Diff line number Diff line change @@ -662,7 +662,7 @@ export class LlamaCompletion {
662662 const text = model . detokenize ( [ token ] ) ;
663663 const queuedTokenRelease = streamRegulator . addChunk ( { tokens, text} ) ;
664664
665- if ( text === UNKNOWN_UNICODE_CHAR || (
665+ if ( text . endsWith ( UNKNOWN_UNICODE_CHAR ) || (
666666 ( grammar ?. trimWhitespaceSuffix || trimWhitespaceSuffix ) && text . trim ( ) === ""
667667 ) ) {
668668 locksToReleaseOnValidGeneration . push ( queuedTokenRelease . createTextIndexLock ( 0 ) ) ;
You can’t perform that action at this time.
0 commit comments