update fileStat()
This commit is contained in:
parent
742e731e96
commit
77f6770333
@ -101,11 +101,11 @@ export default class llamacpp_extension extends AIEngine {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`Failed to unload session ${sessionId}:`, error);
|
console.error(`Failed to unload session ${sessionId}:`, error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear the sessions map
|
// Clear the sessions map
|
||||||
this.activeSessions.clear();
|
this.activeSessions.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implement the required LocalProvider interface methods
|
// Implement the required LocalProvider interface methods
|
||||||
override async list(): Promise<modelInfo[]> {
|
override async list(): Promise<modelInfo[]> {
|
||||||
@ -133,10 +133,8 @@ export default class llamacpp_extension extends AIEngine {
|
|||||||
// otherwise, look into subdirectories
|
// otherwise, look into subdirectories
|
||||||
const children = await fs.readdirSync(currentDir)
|
const children = await fs.readdirSync(currentDir)
|
||||||
for (const child of children) {
|
for (const child of children) {
|
||||||
// NOTE: currently fs.fileStat() output is a string
|
|
||||||
// TODO: fix this in core
|
|
||||||
// skip files
|
// skip files
|
||||||
const dirInfo = await fs.fileStat(child).then(JSON.parse)
|
const dirInfo = await fs.fileStat(child)
|
||||||
if (!dirInfo.isDirectory) {
|
if (!dirInfo.isDirectory) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user