Commit 584604c
committed
Fix README: empty Type for Gemma 4 Text + sort by architecture version
Two bugs in update_all_notebooks.py that produced visibly wrong README rows.
1. Empty Type column for Gemma 4 Text notebooks
-------------------------------------------------
The four Gemma 4 Text notebooks (Gemma4_(E2B)-Text.ipynb,
Gemma4_(E4B)-Text.ipynb, Gemma4_(31B)-Text.ipynb,
Gemma4_(26B_A4B)-Text.ipynb) were rendered in README.md with an empty
Type column. extract_model_info_refined searches the filename for any
keyword in KNOWN_TYPES_ORDERED via word-boundary regex, and "Text" is
not in that list, so type_ stayed None.
Fix: add four FIRST_MAPPING_NAME entries that map each Gemma4_(*)-Text
filename to Gemma4_(*)-Conversational for type-extraction purposes
only. The on-disk filenames are unchanged. This matches the existing
pattern used for Gemma3 (Gemma3_(4B).ipynb -> Gemma3_(4B)-Conversational
.ipynb) and produces "Conversational" in the Type column.
2. Sort by architecture version, not by parameter count
--------------------------------------------------------
extract_version("**(A100) Gemma3** **(27B)**") returned (100, 0) because
the function pulled the first digit-run out of the model name string and
A100 happens to contain "100". Similarly extract_version for
"**EmbeddingGemma** **(300M)**" returned (300, 0) from the parameter
count. The result was the Gemma section sorted as
EmbeddingGemma -> FunctionGemma -> (A100) Gemma3 -> CodeGemma -> Gemma4
-> Gemma3N -> Gemma3 -> Gemma2, which is neither parameter-count
order nor architecture-version order.
Fix: extract_version now strips the trailing **(size)** suffix, the
"(A100)" prefix, and the markdown ** markers before searching for the
version digit. The architecture version (Gemma4 -> 4, Gemma3 -> 3,
Llama3.1 -> (3,1), Phi 4 -> 4) is now identified correctly.
After the fix, the Gemma section is ordered:
Gemma4 (E4B/E2B/31B/26B A4B)
Gemma3N (4B/2B)
Gemma3 (4B/270M/(A100) 27B)
Gemma2 (9B/2B)
FunctionGemma / EmbeddingGemma / CodeGemma (no version digit)
The Llama section is also fixed: previously Llama3.2 (1B) was placed
above Llama3.3 (70B) because 70 > 1. Now: Llama3.3 -> Llama3.2 ->
Llama3.1 -> Llama3 -> TinyLlama.
Verified with 22 unit tests covering Gemma 2/3/3N/4, (A100) prefix,
Llama3.x, Phi 4, Qwen3.5, Granite4.0, and architecture names with no
version digit.
Net diff: README.md +57 / -57 (rows shuffled, no rows added or
removed except the four Type column corrections).1 parent 8ef15ba commit 584604c
2 files changed
+87
-60
lines changed
0 commit comments