Skip to content

Commit

Permalink
fix: wrong engine handling (janhq#2363)
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-jan authored Mar 14, 2024
1 parent e40d048 commit 58e12f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extensions/tensorrt-llm-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ export default class TensorRTLLMExtension extends LocalOAIEngine {
}

async onModelInit(model: Model): Promise<void> {
if (model.engine !== this.provider) return

if ((await this.installationState()) === 'Installed')
return super.onModelInit(model)
else {
Expand All @@ -138,7 +140,6 @@ export default class TensorRTLLMExtension extends LocalOAIEngine {
message: 'EXTENSION_IS_NOT_INSTALLED::TensorRT-LLM extension',
},
})
return
}
}

Expand All @@ -162,6 +163,7 @@ export default class TensorRTLLMExtension extends LocalOAIEngine {
}

inference(data: MessageRequest): void {
if (!this.isRunning) return
// TensorRT LLM Extension supports streaming only
if (data.model) data.model.parameters.stream = true
super.inference(data)
Expand Down

0 comments on commit 58e12f3

Please sign in to comment.