forked from janhq/jan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: remove unused hooks and resolve no-explicit-any
- Loading branch information
1 parent
cc68e42
commit bb78683
Showing
13 changed files
with
61 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
*/ | ||
|
||
import { | ||
ChatCompletionMessage, | ||
ChatCompletionRole, | ||
EventName, | ||
MessageRequest, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
interface Version { | ||
name: string | ||
quantMethod: string | ||
bits: number | ||
size: number | ||
maxRamRequired: number | ||
usecase: string | ||
downloadLink: string | ||
} | ||
interface ModelSchema { | ||
id: string | ||
name: string | ||
shortDescription: string | ||
avatarUrl: string | ||
longDescription: string | ||
author: string | ||
version: string | ||
modelUrl: string | ||
tags: string[] | ||
versions: Version[] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,32 @@ | ||
export const parseToModel = (model) => { | ||
import { ModelCatalog } from '@janhq/core' | ||
|
||
export function parseToModel(schema: ModelSchema): ModelCatalog { | ||
const modelVersions = [] | ||
model.versions.forEach((v) => { | ||
schema.versions.forEach((v) => { | ||
const version = { | ||
id: `${model.author}-${v.name}`, | ||
name: v.name, | ||
quantMethod: v.quantMethod, | ||
bits: v.bits, | ||
size: v.size, | ||
maxRamRequired: v.maxRamRequired, | ||
usecase: v.usecase, | ||
downloadLink: v.downloadLink, | ||
productId: model.id, | ||
} | ||
modelVersions.push(version) | ||
}) | ||
|
||
const product = { | ||
id: model.id, | ||
name: model.name, | ||
shortDescription: model.shortDescription, | ||
avatarUrl: model.avatarUrl, | ||
author: model.author, | ||
version: model.version, | ||
modelUrl: model.modelUrl, | ||
nsfw: model.nsfw, | ||
tags: model.tags, | ||
greeting: model.defaultGreeting, | ||
type: model.type, | ||
createdAt: model.createdAt, | ||
longDescription: model.longDescription, | ||
status: 'Downloadable', | ||
const model: ModelCatalog = { | ||
id: schema.id, | ||
name: schema.name, | ||
shortDescription: schema.shortDescription, | ||
avatarUrl: schema.avatarUrl, | ||
author: schema.author, | ||
version: schema.version, | ||
modelUrl: schema.modelUrl, | ||
tags: schema.tags, | ||
longDescription: schema.longDescription, | ||
releaseDate: 0, | ||
availableVersions: modelVersions, | ||
} | ||
return product | ||
return model | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters