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,
|
||||
joinPath,
|
||||
dirName,
|
||||
fs,
|
||||
ModelManager,
|
||||
abortDownload,
|
||||
DownloadState,
|
||||
@ -181,7 +182,8 @@ export default class JanModelExtension extends ModelExtension {
|
||||
toImportModels.map(async (model: Model & { file_path: string }) =>
|
||||
this.importModel(
|
||||
model.id,
|
||||
model.sources[0].url.startsWith('http')
|
||||
model.sources[0].url.startsWith('http') ||
|
||||
!(await fs.existsSync(model.sources[0].url))
|
||||
? await joinPath([
|
||||
await dirName(model.file_path),
|
||||
model.sources[0]?.filename ??
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user