Skip to content

Commit

Permalink
fix: model path backward compatible (janhq#2018)
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-jan authored Feb 14, 2024
1 parent f2e3187 commit f0fd2c5
Show file tree
Hide file tree
Showing 12 changed files with 185 additions and 209 deletions.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions core/src/node/api/processors/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export class Downloader implements Processor {
const currentDownloadState = DownloadManager.instance.downloadProgressMap[modelId]
const downloadState: DownloadState = {
...currentDownloadState,
error: error.message,
downloadState: 'error',
}
if (currentDownloadState) {
Expand Down
8 changes: 0 additions & 8 deletions electron/.prettierrc

This file was deleted.

8 changes: 0 additions & 8 deletions extensions/conversational-extension/.prettierrc

This file was deleted.

10 changes: 7 additions & 3 deletions extensions/inference-nitro-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
ModelEvent,
InferenceEvent,
ModelSettingParams,
getJanDataFolderPath,
} from "@janhq/core";
import { requestInference } from "./helpers/sse";
import { ulid } from "ulid";
Expand Down Expand Up @@ -146,11 +147,14 @@ export default class JanInferenceNitroExtension extends InferenceExtension {
private async onModelInit(model: Model) {
if (model.engine !== InferenceEngine.nitro) return;

const modelFullPath = await joinPath(["models", model.id]);

const modelFolder = await joinPath([
await getJanDataFolderPath(),
"models",
model.id,
]);
this._currentModel = model;
const nitroInitResult = await executeOnMain(NODE, "runModel", {
modelFullPath,
modelFolder,
model,
});

Expand Down
Loading

0 comments on commit f0fd2c5

Please sign in to comment.