Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix][Grammar] Detach token table to prevent disposing it (#571)
Prior to this PR, when reusing the same engine but for different schema will run into error "Module has already been disposed". An example to reproduce this is included in #560. This is because `this.tokenTable` is a `tvmjs.TVMObject` and will be disposed after the scope ends. We fix this by wrapping the call with `this.tvm.detachFromCurrentScope()`, and only dispose `this.tokenTable` when we dispose the entire `LLMChatPipeline`. Co-authored-by: SMarioMan <[email protected]>
- Loading branch information