fix: wait for model start
This commit is contained in:
parent
54691044d4
commit
5edc773535
@ -1,5 +1,10 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
import { AIEngine, EngineManager, SettingComponentProps } from '@janhq/core'
|
import {
|
||||||
|
AIEngine,
|
||||||
|
EngineManager,
|
||||||
|
SessionInfo,
|
||||||
|
SettingComponentProps,
|
||||||
|
} from '@janhq/core'
|
||||||
import { Model as CoreModel } from '@janhq/core'
|
import { Model as CoreModel } from '@janhq/core'
|
||||||
|
|
||||||
// TODO: Replace this with the actual provider later
|
// TODO: Replace this with the actual provider later
|
||||||
@ -138,8 +143,8 @@ export const stopAllModels = async () => {
|
|||||||
export const startModel = async (
|
export const startModel = async (
|
||||||
provider: ProviderObject,
|
provider: ProviderObject,
|
||||||
model: string
|
model: string
|
||||||
): Promise<void> => {
|
): Promise<SessionInfo> => {
|
||||||
getEngine(provider.provider)
|
return getEngine(provider.provider)
|
||||||
.load(model)
|
.load(model)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error(
|
console.error(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user