fix: persists model.json on download (legacy models)

This commit is contained in:
Louis 2024-10-28 19:25:45 +07:00
parent a466bbca38
commit e5f5d887e3
No known key found for this signature in database
GPG Key ID: 44FA9F4D33C37DE2

View File

@ -19,6 +19,14 @@ export const downloadModel = async (
const modelDirPath = await joinPath([homedir, model.id])
if (!(await fs.existsSync(modelDirPath))) await fs.mkdir(modelDirPath)
const jsonFilePath = await joinPath([modelDirPath, 'model.json'])
// Write model.json on download
if (!(await fs.existsSync(jsonFilePath)))
await fs.writeFileSync(
jsonFilePath,
JSON.stringify(model, null, 2)
)
if (model.engine === InferenceEngine.nitro_tensorrt_llm) {
if (!gpuSettings || gpuSettings.gpus.length === 0) {
console.error('No GPU found. Please check your GPU setting.')