Commit fef3bc3
authored
Add T5Gemma to KerasHub (#2339)
* init: Add initial project structure and files
* nit: Fix code format test; and cool AI-generated reviews
* refactor: Cleanup and replace incorrect T5LayerNorm with RMSNormalization (Gemma)
* fix: Numerics @ atol=1e-4
* refactor: Refactor T5Gemma decoder cache handling
* feat: Add checkpoint conversion script
* nit: Precise compute_output_shape methods; document head_dim
* nit: Propagate dtypes
* bug fix + minor cleanup: Fix head_dim default → head_dim from config
* perf(jax/tpu): Fused kernel optim for TPU backend + get_config() args
* cleanup: Slight refactor
* fix: Enable mixed precision and quantization tests
* feat: Add support for asymmetrical presets (only invariants included)
* refactor: Address reviews - presets will be handled post D-FINE
* feat: Support direct loading of Hugging Face checkpoints
* ✅ Yayy: Generate outputs identical, hidden states match within 1e-3
* preset test: Register and test a preset (to be replaced later by the team with the full set)
* nit: Sharded weights don’t include `model.weights.h5`
* nits: Address reviews + replace gated model1 parent 61fda7f commit fef3bc3
File tree
18 files changed
+3202
-0
lines changed- keras_hub
- api
- models
- tokenizers
- src
- models/t5gemma
- utils/transformers
- tools/checkpoint_conversion
18 files changed
+3202
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
615 | 615 | | |
616 | 616 | | |
617 | 617 | | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
618 | 630 | | |
619 | 631 | | |
620 | 632 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments