Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +62 -0
- comparison_graph.png +0 -0
- config.json +62 -0
- generation_config.json +5 -0
- model.safetensors +3 -0
- tokenizer.json +3 -0
- tokenizer_config.json +24 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- pruned
|
| 5 |
+
- python
|
| 6 |
+
- optimized
|
| 7 |
+
- wanda
|
| 8 |
+
base_model: google/gemma-3-270m
|
| 9 |
+
pipeline_tag: text-generation
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# gemma-3-270m-python-safe
|
| 13 |
+
|
| 14 |
+
> 🎯 **PYTHON-optimized** | 📦 **Safe** pruning | ⚡ **1% weights pruned**
|
| 15 |
+
|
| 16 |
+
This model is a **conservatively pruned** version of [google/gemma-3-270m](https://huggingface.co/google/gemma-3-270m).
|
| 17 |
+
**Community-requested model.**
|
| 18 |
+
|
| 19 |
+
## Performance Comparison
|
| 20 |
+
|
| 21 |
+
| Category | Original | Pruned | Change |
|
| 22 |
+
|----------|----------|--------|--------|
|
| 23 |
+
| **Python** | 0.0% | 0.0% ⭐ | → |
|
| 24 |
+
| Html | 0.0% | 0.0% | → |
|
| 25 |
+
| Trivia | 0.0% | 0.0% | → |
|
| 26 |
+
| Math | 0.0% | 0.0% | → |
|
| 27 |
+
| Reasoning | 0.0% | 0.0% | → |
|
| 28 |
+
| Medical | 0.0% | 0.0% | → |
|
| 29 |
+
| Linux | 0.0% | 0.0% | → |
|
| 30 |
+
| Writing | 0.0% | 0.0% | → |
|
| 31 |
+
|
| 32 |
+
**Average**: 0.0% → 0.0% (+0.0%)
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+

|
| 37 |
+
|
| 38 |
+
## Quick Start
|
| 39 |
+
|
| 40 |
+
```python
|
| 41 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 42 |
+
|
| 43 |
+
model = AutoModelForCausalLM.from_pretrained("CompactAI/gemma-3-270m-python-safe")
|
| 44 |
+
tokenizer = AutoTokenizer.from_pretrained("CompactAI/gemma-3-270m-python-safe")
|
| 45 |
+
|
| 46 |
+
inputs = tokenizer("Your prompt here", return_tensors="pt")
|
| 47 |
+
outputs = model.generate(**inputs, max_new_tokens=100)
|
| 48 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
## Technical Details
|
| 52 |
+
|
| 53 |
+
| Property | Value |
|
| 54 |
+
|----------|-------|
|
| 55 |
+
| Base Model | [google/gemma-3-270m](https://huggingface.co/google/gemma-3-270m) |
|
| 56 |
+
| Specialization | Python |
|
| 57 |
+
| Prune Mode | Safe |
|
| 58 |
+
| Weight Reduction | 1% weights pruned |
|
| 59 |
+
|
| 60 |
+
## License
|
| 61 |
+
|
| 62 |
+
This model inherits the license from the base model.
|
comparison_graph.png
ADDED
|
config.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_sliding_window_pattern": 6,
|
| 3 |
+
"architectures": [
|
| 4 |
+
"Gemma3ForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_bias": false,
|
| 7 |
+
"attention_dropout": 0.0,
|
| 8 |
+
"attn_logit_softcapping": null,
|
| 9 |
+
"bos_token_id": 2,
|
| 10 |
+
"dtype": "float16",
|
| 11 |
+
"eos_token_id": 1,
|
| 12 |
+
"final_logit_softcapping": null,
|
| 13 |
+
"head_dim": 256,
|
| 14 |
+
"hidden_activation": "gelu_pytorch_tanh",
|
| 15 |
+
"hidden_size": 640,
|
| 16 |
+
"initializer_range": 0.02,
|
| 17 |
+
"intermediate_size": 2048,
|
| 18 |
+
"layer_types": [
|
| 19 |
+
"sliding_attention",
|
| 20 |
+
"sliding_attention",
|
| 21 |
+
"sliding_attention",
|
| 22 |
+
"sliding_attention",
|
| 23 |
+
"sliding_attention",
|
| 24 |
+
"full_attention",
|
| 25 |
+
"sliding_attention",
|
| 26 |
+
"sliding_attention",
|
| 27 |
+
"sliding_attention",
|
| 28 |
+
"sliding_attention",
|
| 29 |
+
"sliding_attention",
|
| 30 |
+
"full_attention",
|
| 31 |
+
"sliding_attention",
|
| 32 |
+
"sliding_attention",
|
| 33 |
+
"sliding_attention",
|
| 34 |
+
"sliding_attention",
|
| 35 |
+
"sliding_attention",
|
| 36 |
+
"full_attention"
|
| 37 |
+
],
|
| 38 |
+
"max_position_embeddings": 32768,
|
| 39 |
+
"model_type": "gemma3_text",
|
| 40 |
+
"num_attention_heads": 4,
|
| 41 |
+
"num_hidden_layers": 18,
|
| 42 |
+
"num_key_value_heads": 1,
|
| 43 |
+
"pad_token_id": 0,
|
| 44 |
+
"query_pre_attn_scalar": 256,
|
| 45 |
+
"rms_norm_eps": 1e-06,
|
| 46 |
+
"rope_parameters": {
|
| 47 |
+
"full_attention": {
|
| 48 |
+
"rope_theta": 1000000.0,
|
| 49 |
+
"rope_type": "default"
|
| 50 |
+
},
|
| 51 |
+
"sliding_attention": {
|
| 52 |
+
"rope_theta": 10000.0,
|
| 53 |
+
"rope_type": "default"
|
| 54 |
+
}
|
| 55 |
+
},
|
| 56 |
+
"sliding_window": 512,
|
| 57 |
+
"tie_word_embeddings": true,
|
| 58 |
+
"transformers_version": "5.0.0",
|
| 59 |
+
"use_bidirectional_attention": false,
|
| 60 |
+
"use_cache": true,
|
| 61 |
+
"vocab_size": 262145
|
| 62 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cache_implementation": "hybrid",
|
| 3 |
+
"do_sample": false,
|
| 4 |
+
"transformers_version": "5.0.0"
|
| 5 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:40c65a53362ca462c7a7831f856599c0e00b9f1d214186b79e2436f829c2f51c
|
| 3 |
+
size 536224096
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c913de4896557181e5ce5f2637582e269e908e9a016ba33bab616a885e3ed0d7
|
| 3 |
+
size 33384697
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"boi_token": "<start_of_image>",
|
| 4 |
+
"bos_token": "<bos>",
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eoi_token": "<end_of_image>",
|
| 7 |
+
"eos_token": "<eos>",
|
| 8 |
+
"image_token": "<image_soft_token>",
|
| 9 |
+
"is_local": false,
|
| 10 |
+
"mask_token": "<mask>",
|
| 11 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 12 |
+
"model_specific_special_tokens": {
|
| 13 |
+
"boi_token": "<start_of_image>",
|
| 14 |
+
"eoi_token": "<end_of_image>",
|
| 15 |
+
"image_token": "<image_soft_token>"
|
| 16 |
+
},
|
| 17 |
+
"pad_token": "<pad>",
|
| 18 |
+
"padding_side": "left",
|
| 19 |
+
"sp_model_kwargs": null,
|
| 20 |
+
"spaces_between_special_tokens": false,
|
| 21 |
+
"tokenizer_class": "GemmaTokenizer",
|
| 22 |
+
"unk_token": "<unk>",
|
| 23 |
+
"use_default_system_prompt": false
|
| 24 |
+
}
|