From 77b555e161307c95ca61bd4a6d22600003c07552 Mon Sep 17 00:00:00 2001 From: SMarioMan Date: Sat, 14 Sep 2024 12:42:37 -0400 Subject: [PATCH] Support multiple JSON schema per engine --- src/llm_chat.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llm_chat.ts b/src/llm_chat.ts index 932e15e9..19e89f29 100644 --- a/src/llm_chat.ts +++ b/src/llm_chat.ts @@ -506,7 +506,7 @@ export class LLMChatPipeline { if (this.grammarStateMatcher) { this.grammarStateMatcher.dispose(); } - if (this.tokenTable === undefined) { + if (this.tokenTable === undefined || !this.tokenTable.handle) { const rawTokenTable = getTokenTableFromTokenizer(this.tokenizer); // Post process entire table this.tokenTable = this.fpostProcessTokenTable(