diff --git a/app/components/ModelManager/ModelItem.tsx b/app/components/ModelManager/ModelItem.tsx index dbd7a86..05efe44 100644 --- a/app/components/ModelManager/ModelItem.tsx +++ b/app/components/ModelManager/ModelItem.tsx @@ -118,8 +118,8 @@ const ModelItem: React.FC = ({ disabled={disable} onPress={async () => { setModelLoading(true) - setAutoLoad(item) await loadModel(item) + setAutoLoad(item) setModelLoading(false) }}> ({ - ...state, - context: llamaContext, - model: model, - })) - } + if (!llamaContext) return + + set((state) => ({ + ...state, + context: llamaContext, + model: model, + })) }, setLoadProgress: (progress: number) => { set((state) => ({ ...state, loadProgress: progress })) @@ -355,15 +369,7 @@ export namespace Llama { }) } - type ModelData = { - context_length?: string - file: string - name?: string - file_size?: number - params?: string - quantization?: string - architecture?: string - } + type ModelData = Omit export const createModelData = async (filename: string, deleteOnFailure: boolean = false) => { const newdir = `${model_dir}${filename}`