fix: an edge case where auto import does not work with relative model file path
This commit is contained in:
parent
2e9b7fdad2
commit
a773e169fc
@ -4,6 +4,7 @@ import {
|
|||||||
InferenceEngine,
|
InferenceEngine,
|
||||||
joinPath,
|
joinPath,
|
||||||
dirName,
|
dirName,
|
||||||
|
fs,
|
||||||
ModelManager,
|
ModelManager,
|
||||||
abortDownload,
|
abortDownload,
|
||||||
DownloadState,
|
DownloadState,
|
||||||
@ -181,7 +182,8 @@ export default class JanModelExtension extends ModelExtension {
|
|||||||
toImportModels.map(async (model: Model & { file_path: string }) =>
|
toImportModels.map(async (model: Model & { file_path: string }) =>
|
||||||
this.importModel(
|
this.importModel(
|
||||||
model.id,
|
model.id,
|
||||||
model.sources[0].url.startsWith('http')
|
model.sources[0].url.startsWith('http') ||
|
||||||
|
!(await fs.existsSync(model.sources[0].url))
|
||||||
? await joinPath([
|
? await joinPath([
|
||||||
await dirName(model.file_path),
|
await dirName(model.file_path),
|
||||||
model.sources[0]?.filename ??
|
model.sources[0]?.filename ??
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user