Skip to content

Commit

Permalink
Use delete models endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
aliasaria committed Jan 9, 2024
1 parent e575abf commit 7edad89
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/renderer/components/ModelZoo/LocalModels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,19 @@ export default function LocalModels({
 
<Trash2Icon
color="var(--joy-palette-danger-600)"
onClick={() => {
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();
}
}}
/>
</>
Expand Down
1 change: 1 addition & 0 deletions src/renderer/lib/transformerlab-api-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 7edad89

Please sign in to comment.