webui: parse effective-parameter sizes (E2B, E4B) as params (#25529)

This commit is contained in:
Emanuil Rusev
2026-07-14 17:12:22 +02:00
committed by GitHub
parent 00e79f6fb1
commit dfba90db63
2 changed files with 8 additions and 1 deletions
+3 -1
View File
@@ -24,8 +24,10 @@ export const MODEL_CUSTOM_QUANTIZATION_PREFIX_RE = /^UD$/i;
/**
* Matches a parameter-count segment, e.g. `7B`, `1.5b`, `120M`.
* The optional leading `E` covers effective-parameter sizes, e.g. Gemma's
* `E2B`/`E4B` (MatFormer models sized by resident params).
*/
export const MODEL_PARAMS_RE = /^\d+(\.\d+)?[BbMmKkTt]$/;
export const MODEL_PARAMS_RE = /^[Ee]?\d+(\.\d+)?[BbMmKkTt]$/;
/**
* Matches an activated-parameter-count segment, e.g. `A10B`, `a2.4b`.
@@ -36,6 +36,11 @@ describe('parseModelId', () => {
expect(parseModelId('model-100b:q4_k_m')).toMatchObject({ params: '100B' });
});
it('extracts effective parameters correctly', () => {
expect(parseModelId('model-E4B-BF16')).toMatchObject({ params: 'E4B' });
expect(parseModelId('model-e2b:q4_k_m')).toMatchObject({ params: 'E2B' });
});
it('extracts activated parameters correctly', () => {
expect(parseModelId('model-100B-A10B-BF16')).toMatchObject({ activatedParams: 'A10B' });
expect(parseModelId('model-100B-A10B:Q4_K_M')).toMatchObject({ activatedParams: 'A10B' });