IMvision12 commited on
Commit
e84bb59
·
verified ·
1 Parent(s): d9604ae

Migrate to zeromodels (rename kf_*.json -> zm_*.json, fix refs in config + README, ensure tag + badge)

Browse files
Files changed (2) hide show
  1. README.md +18 -18
  2. kf_config.json → zm_config.json +3 -3
README.md CHANGED
@@ -2,13 +2,13 @@
2
  pipeline_tag: text-generation
3
  license: gemma
4
  base_model: google/gemma-7b-it
5
- library_name: kerasformers
6
  extra_gated_heading: Access Gemma on Hugging Face
7
  language:
8
  - en
9
  tags:
10
  - keras
11
- - kerasformers
12
  - gemma
13
  - gemma-7b
14
  - text-generation
@@ -18,13 +18,13 @@ tags:
18
  - tf
19
  ---
20
 
21
- ## ***See [our collection](https://huggingface.co/collections/kerasformers/gemma-6a69aaecae0f1f518733ffa1) for all versions of Gemma.***
22
 
23
  # Run Gemma with Keras 3: JAX, PyTorch, or TensorFlow
24
 
25
- [![GitHub](https://img.shields.io/badge/GitHub-KerasFormers-black?logo=github)](https://github.com/IMvision12/KerasFormers) [![Docs](https://img.shields.io/badge/Docs-Gemma-blue)](https://imvision12.github.io/KerasFormers/gemma/) [![Collection](https://img.shields.io/badge/HF-Gemma%20collection-yellow)](https://huggingface.co/collections/kerasformers/gemma-6a69aaecae0f1f518733ffa1)
26
 
27
- # kerasformers/gemma-7b-it
28
 
29
  Paper: [Gemma: Open Models Based on Gemini Research and Technology (arXiv:2403.08295)](https://arxiv.org/abs/2403.08295) · [HF Papers](https://huggingface.co/papers/2403.08295)
30
 
@@ -32,7 +32,7 @@ Gemma is Google's open decoder-only LLM family (RMSNorm, GeGLU, RoPE, multi-quer
32
 
33
  For more details on the model, please go to Google's original [model card](https://huggingface.co/google/gemma-7b-it).
34
 
35
- Pure-**Keras 3** conversion of [`google/gemma-7b-it`](https://huggingface.co/google/gemma-7b-it) for [kerasformers](https://github.com/IMvision12/KerasFormers). One implementation runs unmodified on **TensorFlow / Torch / JAX**.
36
 
37
  This is an **instruction-tuned** checkpoint: use the chat template via `GemmaTokenizer`.
38
 
@@ -42,10 +42,10 @@ This is an **instruction-tuned** checkpoint: use the chat template via `GemmaTok
42
  import os
43
  os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
44
 
45
- from kerasformers.models.gemma import GemmaTextGenerate, GemmaTokenizer
46
 
47
- model = GemmaTextGenerate.from_weights("kerasformers/gemma-7b-it")
48
- tokenizer = GemmaTokenizer.from_weights("kerasformers/gemma-7b-it")
49
 
50
  inputs = tokenizer([
51
  {"role": "user", "content": "Explain rotary embeddings in one sentence."}
@@ -54,23 +54,23 @@ outputs = model.generate(**inputs, max_new_tokens=64)
54
  print(tokenizer.decode(outputs[0]))
55
  ```
56
 
57
- Load any Gemma v1 variant the same way with `from_weights("kerasformers/<variant>")`:
58
 
59
  | Variant | Hub | Type |
60
  |---|---|---|
61
- | `gemma-2b` | [`kerasformers/gemma-2b`](https://huggingface.co/kerasformers/gemma-2b) | base |
62
- | `gemma-2b-it` | [`kerasformers/gemma-2b-it`](https://huggingface.co/kerasformers/gemma-2b-it) | instruct |
63
- | `gemma-1.1-2b-it` | [`kerasformers/gemma-1.1-2b-it`](https://huggingface.co/kerasformers/gemma-1.1-2b-it) | instruct (1.1) |
64
- | `gemma-7b` | [`kerasformers/gemma-7b`](https://huggingface.co/kerasformers/gemma-7b) | base |
65
- | `gemma-7b-it` | [`kerasformers/gemma-7b-it`](https://huggingface.co/kerasformers/gemma-7b-it) | instruct |
66
- | `gemma-1.1-7b-it` | [`kerasformers/gemma-1.1-7b-it`](https://huggingface.co/kerasformers/gemma-1.1-7b-it) | instruct (1.1) |
67
 
68
  ## Tips
69
 
70
- - Set `KERAS_BACKEND` **before** importing Keras / kerasformers.
71
  - Prefer `GemmaTokenizer.from_weights(...)` so the chat template matches.
72
  - Larger checkpoints: try `load_dtype="bfloat16"` or `quantization="int8"`.
73
- - See [Gemma docs](https://imvision12.github.io/KerasFormers/gemma/) and [Loading Weights](https://imvision12.github.io/KerasFormers/loading_weights/).
74
  - Community / upstream safetensors still work via the `hf:` prefix, e.g. `GemmaTextGenerate.from_weights("hf:google/gemma-7b-it")`.
75
 
76
  ## Special Thanks
 
2
  pipeline_tag: text-generation
3
  license: gemma
4
  base_model: google/gemma-7b-it
5
+ library_name: zeromodels
6
  extra_gated_heading: Access Gemma on Hugging Face
7
  language:
8
  - en
9
  tags:
10
  - keras
11
+ - zeromodels
12
  - gemma
13
  - gemma-7b
14
  - text-generation
 
18
  - tf
19
  ---
20
 
21
+ ## ***See [our collection](https://huggingface.co/collections/zeromodels/gemma-6a69aaecae0f1f518733ffa1) for all versions of Gemma.***
22
 
23
  # Run Gemma with Keras 3: JAX, PyTorch, or TensorFlow
24
 
25
+ [![GitHub](https://img.shields.io/badge/GitHub-ZeroModels-black?logo=github)](https://github.com/IMvision12/ZeroModels) [![Docs](https://img.shields.io/badge/Docs-Gemma-blue)](https://imvision12.github.io/ZeroModels/gemma/) [![Collection](https://img.shields.io/badge/HF-Gemma%20collection-yellow)](https://huggingface.co/collections/zeromodels/gemma-6a69aaecae0f1f518733ffa1)
26
 
27
+ # zeromodels/gemma-7b-it
28
 
29
  Paper: [Gemma: Open Models Based on Gemini Research and Technology (arXiv:2403.08295)](https://arxiv.org/abs/2403.08295) · [HF Papers](https://huggingface.co/papers/2403.08295)
30
 
 
32
 
33
  For more details on the model, please go to Google's original [model card](https://huggingface.co/google/gemma-7b-it).
34
 
35
+ Pure-**Keras 3** conversion of [`google/gemma-7b-it`](https://huggingface.co/google/gemma-7b-it) for [zeromodels](https://github.com/IMvision12/ZeroModels). One implementation runs unmodified on **TensorFlow / Torch / JAX**.
36
 
37
  This is an **instruction-tuned** checkpoint: use the chat template via `GemmaTokenizer`.
38
 
 
42
  import os
43
  os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
44
 
45
+ from zeromodels.models.gemma import GemmaTextGenerate, GemmaTokenizer
46
 
47
+ model = GemmaTextGenerate.from_weights("zeromodels/gemma-7b-it")
48
+ tokenizer = GemmaTokenizer.from_weights("zeromodels/gemma-7b-it")
49
 
50
  inputs = tokenizer([
51
  {"role": "user", "content": "Explain rotary embeddings in one sentence."}
 
54
  print(tokenizer.decode(outputs[0]))
55
  ```
56
 
57
+ Load any Gemma v1 variant the same way with `from_weights("zeromodels/<variant>")`:
58
 
59
  | Variant | Hub | Type |
60
  |---|---|---|
61
+ | `gemma-2b` | [`zeromodels/gemma-2b`](https://huggingface.co/zeromodels/gemma-2b) | base |
62
+ | `gemma-2b-it` | [`zeromodels/gemma-2b-it`](https://huggingface.co/zeromodels/gemma-2b-it) | instruct |
63
+ | `gemma-1.1-2b-it` | [`zeromodels/gemma-1.1-2b-it`](https://huggingface.co/zeromodels/gemma-1.1-2b-it) | instruct (1.1) |
64
+ | `gemma-7b` | [`zeromodels/gemma-7b`](https://huggingface.co/zeromodels/gemma-7b) | base |
65
+ | `gemma-7b-it` | [`zeromodels/gemma-7b-it`](https://huggingface.co/zeromodels/gemma-7b-it) | instruct |
66
+ | `gemma-1.1-7b-it` | [`zeromodels/gemma-1.1-7b-it`](https://huggingface.co/zeromodels/gemma-1.1-7b-it) | instruct (1.1) |
67
 
68
  ## Tips
69
 
70
+ - Set `KERAS_BACKEND` **before** importing Keras / zeromodels.
71
  - Prefer `GemmaTokenizer.from_weights(...)` so the chat template matches.
72
  - Larger checkpoints: try `load_dtype="bfloat16"` or `quantization="int8"`.
73
+ - See [Gemma docs](https://imvision12.github.io/ZeroModels/gemma/) and [Loading Weights](https://imvision12.github.io/ZeroModels/loading_weights/).
74
  - Community / upstream safetensors still work via the `hf:` prefix, e.g. `GemmaTextGenerate.from_weights("hf:google/gemma-7b-it")`.
75
 
76
  ## Special Thanks
kf_config.json → zm_config.json RENAMED
@@ -1,7 +1,7 @@
1
  {
2
- "library_name": "kerasformers",
3
- "kerasformers_version": "1.2.1",
4
- "model_module": "kerasformers.models.gemma",
5
  "model_class": "GemmaTextGenerate",
6
  "variant": "gemma-7b-it",
7
  "weights": "model.weights.json",
 
1
  {
2
+ "library_name": "zeromodels",
3
+ "zeromodels_version": "1.2.1",
4
+ "model_module": "zeromodels.models.gemma",
5
  "model_class": "GemmaTextGenerate",
6
  "variant": "gemma-7b-it",
7
  "weights": "model.weights.json",