enhancement: Add support for mmproj models (#6150)
This commit is contained in:
parent
186e6c5bc9
commit
5266583e5b
@ -288,7 +288,8 @@ function Hub() {
|
|||||||
const handleDownload = () => {
|
const handleDownload = () => {
|
||||||
// Immediately set local downloading state
|
// Immediately set local downloading state
|
||||||
addLocalDownloadingModel(modelId)
|
addLocalDownloadingModel(modelId)
|
||||||
pullModel(modelId, modelUrl)
|
const mmprojPath = model.mmproj_models?.[0]?.path
|
||||||
|
pullModel(modelId, modelUrl, mmprojPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -749,7 +750,10 @@ function Hub() {
|
|||||||
)
|
)
|
||||||
pullModel(
|
pullModel(
|
||||||
variant.model_id,
|
variant.model_id,
|
||||||
variant.path
|
variant.path,
|
||||||
|
filteredModels[
|
||||||
|
virtualItem.index
|
||||||
|
].mmproj_models?.[0]?.path
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -12,6 +12,12 @@ export interface ModelQuant {
|
|||||||
file_size: string
|
file_size: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface MMProjModel {
|
||||||
|
model_id: string
|
||||||
|
path: string
|
||||||
|
file_size: string
|
||||||
|
}
|
||||||
|
|
||||||
export interface CatalogModel {
|
export interface CatalogModel {
|
||||||
model_name: string
|
model_name: string
|
||||||
description: string
|
description: string
|
||||||
@ -19,6 +25,7 @@ export interface CatalogModel {
|
|||||||
downloads: number
|
downloads: number
|
||||||
num_quants: number
|
num_quants: number
|
||||||
quants: ModelQuant[]
|
quants: ModelQuant[]
|
||||||
|
mmproj_models?: MMProjModel[]
|
||||||
created_at?: string
|
created_at?: string
|
||||||
readme?: string
|
readme?: string
|
||||||
}
|
}
|
||||||
@ -201,9 +208,14 @@ export const updateModel = async (
|
|||||||
* @param model The model to pull.
|
* @param model The model to pull.
|
||||||
* @returns A promise that resolves when the model download task is created.
|
* @returns A promise that resolves when the model download task is created.
|
||||||
*/
|
*/
|
||||||
export const pullModel = async (id: string, modelPath: string) => {
|
export const pullModel = async (
|
||||||
|
id: string,
|
||||||
|
modelPath: string,
|
||||||
|
mmprojPath?: string
|
||||||
|
) => {
|
||||||
return getEngine()?.import(id, {
|
return getEngine()?.import(id, {
|
||||||
modelPath,
|
modelPath,
|
||||||
|
mmprojPath,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user