mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-10-11 15:30:39 +02:00
feat: Remove sorting from Status column in Models Table
This commit is contained in:
+2
-9
@@ -7,8 +7,7 @@
|
||||
hasActiveFilters,
|
||||
modelContextLength,
|
||||
type ModelQuantGroup,
|
||||
type ModelsTableGroup,
|
||||
statusRank
|
||||
type ModelsTableGroup
|
||||
} from './utils';
|
||||
import {
|
||||
ArrowDown,
|
||||
@@ -155,10 +154,6 @@
|
||||
return (modelContextLength(a) ?? 0) - (modelContextLength(b) ?? 0);
|
||||
case ModelsTableSortKey.NAME:
|
||||
return a.model.localeCompare(b.model);
|
||||
case ModelsTableSortKey.STATUS:
|
||||
// a running model leads, then one that is being worked on (loading,
|
||||
// sleeping), then the rest; the reported status sorts the row's own cell
|
||||
return statusRank(b) - statusRank(a);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
@@ -357,9 +352,7 @@
|
||||
{@render sortHeader(ModelsTableSortKey.CONTEXT, 'Context')}
|
||||
</span>
|
||||
|
||||
<span class="justify-self-center max-md:hidden">
|
||||
{@render sortHeader(ModelsTableSortKey.STATUS, 'Status')}
|
||||
</span>
|
||||
<span class="justify-self-center max-md:hidden">Status</span>
|
||||
|
||||
<span class="text-center max-md:hidden">Actions</span>
|
||||
</div>
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import { LOCAL_BACKEND_ID, type ModalityKey } from '$lib/constants';
|
||||
import {
|
||||
ModelCapability,
|
||||
ModelGroupKind,
|
||||
ModelsTableGroupKind,
|
||||
ServerModelStatus
|
||||
} from '$lib/enums';
|
||||
import { ModelCapability, ModelGroupKind, ModelsTableGroupKind } from '$lib/enums';
|
||||
import { HuggingFaceService, ModelsService } from '$lib/services';
|
||||
import { modelsStore } from '$lib/stores';
|
||||
import type { ModelDownloadEntry, ModelDownloadProgress, ModelOption } from '$lib/types/models';
|
||||
@@ -27,20 +22,6 @@ export function hasActiveFilters(
|
||||
return contextLimit > 0 || modalities.length > 0 || capabilities.length > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Order a status sorts behind: loaded first, then a model being worked on
|
||||
* (loading, sleeping), then the rest.
|
||||
*/
|
||||
export function statusRank(option: ModelOption): number {
|
||||
const status = modelsStore.getModelStatus(option.model);
|
||||
|
||||
if (modelsStore.isModelRunning(option.model)) return 2;
|
||||
|
||||
if (status === ServerModelStatus.LOADING || status === ServerModelStatus.SLEEPING) return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** Byte counts of a tracked download: live while it runs, frozen while paused. */
|
||||
export function downloadProgressFor(repoWithTag: string): ModelDownloadProgress | null {
|
||||
return (
|
||||
|
||||
@@ -80,6 +80,5 @@ export enum ModelRowDownloadState {
|
||||
/** Column the models manager table can be ordered by. */
|
||||
export enum ModelsTableSortKey {
|
||||
CONTEXT = 'context',
|
||||
NAME = 'name',
|
||||
STATUS = 'status'
|
||||
NAME = 'name'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user