diff --git a/src/renderer/components/ModelZoo/LocalModels.tsx b/src/renderer/components/ModelZoo/LocalModels.tsx index 7faae122..80043c8d 100644 --- a/src/renderer/components/ModelZoo/LocalModels.tsx +++ b/src/renderer/components/ModelZoo/LocalModels.tsx @@ -317,8 +317,19 @@ export default function LocalModels({   { - mutate(); + onClick={async () => { + if ( + confirm( + "Are you sure you want to delete model '" + + row.model_id + + "'?" + ) + ) { + await fetch( + chatAPI.Endpoints.Models.Delete(row.model_id) + ); + mutate(); + } }} /> diff --git a/src/renderer/lib/transformerlab-api-sdk.ts b/src/renderer/lib/transformerlab-api-sdk.ts index 025b8f59..1e684244 100644 --- a/src/renderer/lib/transformerlab-api-sdk.ts +++ b/src/renderer/lib/transformerlab-api-sdk.ts @@ -436,6 +436,7 @@ Endpoints.Models = { ModelDetailsFromGallery: (modelId: string) => API_URL() + 'model/gallery/' + convertSlashInUrl(modelId), HuggingFaceLogin: () => API_URL() + 'model/login_to_huggingface', + Delete: (modelId: string) => API_URL() + 'model/delete?model_id=' + modelId, }; Endpoints.Plugins = {