* feat: Deprecate model.json ready state in favor of .download ext * refactor: resolve ts ignore * chore: fix warning * fix: path polyfill on Windows
13 lines
357 B
TypeScript
13 lines
357 B
TypeScript
import { basename } from 'path'
|
|
|
|
import { Model } from '@janhq/core'
|
|
|
|
export const modelBinFileName = (model: Model) => {
|
|
const modelFormatExt = '.gguf'
|
|
const extractedFileName = basename(model.source_url) ?? model.id
|
|
const fileName = extractedFileName.toLowerCase().endsWith(modelFormatExt)
|
|
? extractedFileName
|
|
: model.id
|
|
return fileName
|
|
}
|