Signed-off-by: James <james@jan.ai> Co-authored-by: James <james@jan.ai>
This commit is contained in:
parent
d852219c4c
commit
666bc01e89
@ -72,7 +72,10 @@ export default class JanModelExtension extends ModelExtension {
|
|||||||
* @param network - Optional object to specify proxy/whether to ignore SSL certificates.
|
* @param network - Optional object to specify proxy/whether to ignore SSL certificates.
|
||||||
* @returns A Promise that resolves when the model is downloaded.
|
* @returns A Promise that resolves when the model is downloaded.
|
||||||
*/
|
*/
|
||||||
async downloadModel(model: Model, network?: { ignoreSSL?: boolean; proxy?: string }): Promise<void> {
|
async downloadModel(
|
||||||
|
model: Model,
|
||||||
|
network?: { ignoreSSL?: boolean; proxy?: string }
|
||||||
|
): Promise<void> {
|
||||||
// create corresponding directory
|
// create corresponding directory
|
||||||
const modelDirPath = await joinPath([JanModelExtension._homeDir, model.id])
|
const modelDirPath = await joinPath([JanModelExtension._homeDir, model.id])
|
||||||
if (!(await fs.existsSync(modelDirPath))) await fs.mkdirSync(modelDirPath)
|
if (!(await fs.existsSync(modelDirPath))) await fs.mkdirSync(modelDirPath)
|
||||||
@ -294,6 +297,11 @@ export default class JanModelExtension extends ModelExtension {
|
|||||||
name: dirName,
|
name: dirName,
|
||||||
created: Date.now(),
|
created: Date.now(),
|
||||||
description: `${dirName} - user self import model`,
|
description: `${dirName} - user self import model`,
|
||||||
|
metadata: {
|
||||||
|
size: binaryFileSize,
|
||||||
|
author: 'User',
|
||||||
|
tags: [],
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const modelFilePath = await joinPath([
|
const modelFilePath = await joinPath([
|
||||||
|
|||||||
@ -9,7 +9,6 @@
|
|||||||
"description": "User self import model",
|
"description": "User self import model",
|
||||||
"settings": {
|
"settings": {
|
||||||
"ctx_len": 4096,
|
"ctx_len": 4096,
|
||||||
"ngl": 0,
|
|
||||||
"embedding": false,
|
"embedding": false,
|
||||||
"prompt_template": "{system_message}\n### Instruction: {prompt}\n### Response:"
|
"prompt_template": "{system_message}\n### Instruction: {prompt}\n### Response:"
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user