mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-09-20 01:31:31 +02:00
ui : derive the syncable parameter list in the parameter sync service
The syncable parameter mapping is only consumed by the sync service, so derive it there from the registry instead of exporting it from the constants file.
This commit is contained in:
@@ -23,8 +23,7 @@ import type {
|
||||
SettingsEntry,
|
||||
SettingsFieldConfig,
|
||||
SettingsSection,
|
||||
SettingsSectionEntry,
|
||||
SyncableParameter
|
||||
SettingsSectionEntry
|
||||
} from '$lib/types';
|
||||
|
||||
/** Settings sections — slug is the routing identity, title is the display label. */
|
||||
@@ -754,15 +753,3 @@ export const NUMERIC_FIELDS = getAllSettings()
|
||||
export const POSITIVE_INTEGER_FIELDS = getAllSettings()
|
||||
.filter((s) => s.isPositiveInteger)
|
||||
.map((s) => s.key) as readonly string[];
|
||||
|
||||
/** Mapping of UI setting keys to server parameter keys, for the sync service. */
|
||||
export const SYNCABLE_PARAMETERS: SyncableParameter[] = SETTINGS_REGISTRY.flatMap(
|
||||
(section) => section.settings
|
||||
)
|
||||
.filter((s) => s.sync !== undefined)
|
||||
.map((s) => ({
|
||||
canSync: true,
|
||||
key: s.key,
|
||||
serverKey: s.sync!.serverKey,
|
||||
type: s.sync!.paramType
|
||||
}));
|
||||
|
||||
@@ -6,11 +6,23 @@
|
||||
* No reactive state; consumed by settingsStore.
|
||||
*/
|
||||
|
||||
import { SETTINGS_KEYS, SYNCABLE_PARAMETERS } from '$lib/constants';
|
||||
import { SETTINGS_KEYS, SETTINGS_REGISTRY } from '$lib/constants';
|
||||
import { ParameterSource, SyncableParameterType } from '$lib/enums';
|
||||
import type { ParameterInfo, ParameterRecord, ParameterValue } from '$lib/types';
|
||||
import type { ParameterInfo, ParameterRecord, ParameterValue, SyncableParameter } from '$lib/types';
|
||||
import { normalizeFloatingPoint } from '$lib/utils';
|
||||
|
||||
/** Mapping of UI setting keys to server parameter keys, derived from the registry. */
|
||||
export const SYNCABLE_PARAMETERS: SyncableParameter[] = SETTINGS_REGISTRY.flatMap(
|
||||
(section) => section.settings
|
||||
)
|
||||
.filter((s) => s.sync !== undefined)
|
||||
.map((s) => ({
|
||||
canSync: true,
|
||||
key: s.key,
|
||||
serverKey: s.sync!.serverKey,
|
||||
type: s.sync!.paramType
|
||||
}));
|
||||
|
||||
export class ParameterSyncService {
|
||||
/**
|
||||
* Check if a parameter can be synced from server.
|
||||
|
||||
Reference in New Issue
Block a user