mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-09-17 20:31:47 +02:00
ui : run format on the branch (sort enums, members, attributes)
Apply eslint --fix across the changed files: sort the SidebarAction enum, ModelsService static members, the sidebar discover-models props, and add a missing blank line in the model-params-fallback hook. This is the result of `npm run format` on the WIP. Assisted-by: llama-ui:Qwen3.8-Flash-Next
This commit is contained in:
+1
-1
@@ -391,6 +391,7 @@
|
||||
bind:searchQuery
|
||||
class="px-2"
|
||||
isExpandedMode={innerWidth > 768 ? uiStore.isSidebarExpanded : true}
|
||||
onDiscoverModelsClick={() => (modelsHubOpen = true)}
|
||||
onNewChat={() => {
|
||||
if (deviceStore.isMobile) {
|
||||
scheduleMobileCollapse();
|
||||
@@ -404,7 +405,6 @@
|
||||
isSearchModeActive = false;
|
||||
searchQuery = '';
|
||||
}}
|
||||
onDiscoverModelsClick={() => (modelsHubOpen = true)}
|
||||
onSettingsClick={() => (settingsDialogOpen = true)}
|
||||
/>
|
||||
|
||||
|
||||
+1
-1
@@ -34,8 +34,8 @@
|
||||
class: className,
|
||||
isExpandedMode = false,
|
||||
isSearchModeActive = $bindable(false),
|
||||
onNewChat,
|
||||
onDiscoverModelsClick,
|
||||
onNewChat,
|
||||
onSearchClick,
|
||||
onSearchDeactivated,
|
||||
onSettingsClick,
|
||||
|
||||
@@ -23,8 +23,8 @@ export enum ScrollCarouselVariant {
|
||||
* Sidebar icon strip actions handled directly by the sidebar.
|
||||
*/
|
||||
export enum SidebarAction {
|
||||
NEW_CHAT = 'new-chat',
|
||||
DISCOVER_MODELS = 'discover-models',
|
||||
NEW_CHAT = 'new-chat',
|
||||
SETTINGS = 'settings'
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ export function useModelParamsFallback(opts: UseModelParamsFallbackOptions) {
|
||||
|
||||
return normalized.includes(MODEL_ID.ORG_SEPARATOR) ? normalized : null;
|
||||
});
|
||||
|
||||
let fetchedParams = $state<number | null>(null);
|
||||
|
||||
$effect(() => {
|
||||
|
||||
@@ -29,23 +29,6 @@ const SIDECAR_TOKENS: readonly string[] = [
|
||||
export class ModelsService {
|
||||
private static readonly SSE_RECONNECT_MS = 1000;
|
||||
|
||||
/**
|
||||
* True when a router entry id is a sidecar-only entry, e.g. `org/model:Q4_0-mtp`
|
||||
* or `org/model:mmproj`. Such entries mark a downloaded sidecar file, not a
|
||||
* loadable model, so the selector skips them.
|
||||
*/
|
||||
static isSidecarEntry(modelId: string): boolean {
|
||||
const idx = modelId.indexOf(MODEL_ID.QUANTIZATION_SEPARATOR);
|
||||
|
||||
if (idx === MODEL_ID.NOT_FOUND) return false;
|
||||
|
||||
const tag = modelId.slice(idx + 1).toLowerCase();
|
||||
const dash = tag.lastIndexOf(MODEL_ID.SEGMENT_SEPARATOR);
|
||||
const token = dash === -1 ? tag : tag.slice(dash + 1);
|
||||
|
||||
return SIDECAR_TOKENS.includes(token);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the `<repo>:<tag>` string expected by POST /models from a parsed
|
||||
* filename quant + optional sidecar type. Used by the model download
|
||||
@@ -121,6 +104,16 @@ export class ModelsService {
|
||||
return model.status.value === ServerModelStatus.LOADED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a model is currently loading.
|
||||
*
|
||||
* @param model - Model data entry from the API response
|
||||
* @returns True if the model status is LOADING
|
||||
*/
|
||||
static isModelLoading(model: ApiModelDataEntry): boolean {
|
||||
return model.status.value === ServerModelStatus.LOADING;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
@@ -130,13 +123,20 @@ export class ModelsService {
|
||||
*/
|
||||
|
||||
/**
|
||||
* Check if a model is currently loading.
|
||||
*
|
||||
* @param model - Model data entry from the API response
|
||||
* @returns True if the model status is LOADING
|
||||
* True when a router entry id is a sidecar-only entry, e.g. `org/model:Q4_0-mtp`
|
||||
* or `org/model:mmproj`. Such entries mark a downloaded sidecar file, not a
|
||||
* loadable model, so the selector skips them.
|
||||
*/
|
||||
static isModelLoading(model: ApiModelDataEntry): boolean {
|
||||
return model.status.value === ServerModelStatus.LOADING;
|
||||
static isSidecarEntry(modelId: string): boolean {
|
||||
const idx = modelId.indexOf(MODEL_ID.QUANTIZATION_SEPARATOR);
|
||||
|
||||
if (idx === MODEL_ID.NOT_FOUND) return false;
|
||||
|
||||
const tag = modelId.slice(idx + 1).toLowerCase();
|
||||
const dash = tag.lastIndexOf(MODEL_ID.SEGMENT_SEPARATOR);
|
||||
const token = dash === -1 ? tag : tag.slice(dash + 1);
|
||||
|
||||
return SIDECAR_TOKENS.includes(token);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user