Skip to content

Commit dfba90d

Browse files
authored
webui: parse effective-parameter sizes (E2B, E4B) as params (ggml-org#25529)
1 parent 00e79f6 commit dfba90d

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

tools/ui/src/lib/constants/model-id.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ export const MODEL_CUSTOM_QUANTIZATION_PREFIX_RE = /^UD$/i;
2424

2525
/**
2626
* Matches a parameter-count segment, e.g. `7B`, `1.5b`, `120M`.
27+
* The optional leading `E` covers effective-parameter sizes, e.g. Gemma's
28+
* `E2B`/`E4B` (MatFormer models sized by resident params).
2729
*/
28-
export const MODEL_PARAMS_RE = /^\d+(\.\d+)?[BbMmKkTt]$/;
30+
export const MODEL_PARAMS_RE = /^[Ee]?\d+(\.\d+)?[BbMmKkTt]$/;
2931

3032
/**
3133
* Matches an activated-parameter-count segment, e.g. `A10B`, `a2.4b`.

tools/ui/tests/unit/model-id-parser.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ describe('parseModelId', () => {
3636
expect(parseModelId('model-100b:q4_k_m')).toMatchObject({ params: '100B' });
3737
});
3838

39+
it('extracts effective parameters correctly', () => {
40+
expect(parseModelId('model-E4B-BF16')).toMatchObject({ params: 'E4B' });
41+
expect(parseModelId('model-e2b:q4_k_m')).toMatchObject({ params: 'E2B' });
42+
});
43+
3944
it('extracts activated parameters correctly', () => {
4045
expect(parseModelId('model-100B-A10B-BF16')).toMatchObject({ activatedParams: 'A10B' });
4146
expect(parseModelId('model-100B-A10B:Q4_K_M')).toMatchObject({ activatedParams: 'A10B' });

0 commit comments

Comments
 (0)