Upload folder using huggingface_hub
#4
by
sharpenb
- opened
- README.md +9 -9
- config.json +3 -3
- generation_config.json +1 -1
- model.safetensors +1 -1
- smash_config.json +1 -1
README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
---
|
2 |
thumbnail: "https://assets-global.website-files.com/646b351987a8d8ce158d1940/64ec9e96b4334c0e1ac41504_Logo%20with%20white%20text.svg"
|
3 |
-
base_model:
|
4 |
metrics:
|
5 |
- memory_disk
|
6 |
- memory_inference
|
@@ -31,14 +31,14 @@ tags:
|
|
31 |
- Contact us and tell us which model to compress next [here](https://www.pruna.ai/contact).
|
32 |
- Request access to easily compress your *own* AI models [here](https://z0halsaff74.typeform.com/pruna-access?typeform-source=www.pruna.ai).
|
33 |
- Read the documentations to know more [here](https://pruna-ai-pruna.readthedocs-hosted.com/en/latest/)
|
34 |
-
- Join Pruna AI community on Discord [here](https://discord.gg/
|
35 |
|
36 |
## Results
|
37 |
|
38 |
![image info](./plots.png)
|
39 |
|
40 |
**Frequently Asked Questions**
|
41 |
-
- ***How does the compression work?*** The model is compressed with
|
42 |
- ***How does the model quality change?*** The quality of the model output might vary compared to the base model.
|
43 |
- ***How is the model efficiency evaluated?*** These results were obtained on HARDWARE_NAME with configuration described in `model/smash_config.json` and are obtained after a hardware warmup. The smashed model is directly compared to the original base model. Efficiency results may vary in other settings (e.g. other hardware, image size, batch size, ...). We recommend to directly run them in the use-case conditions to know if the smashed model can benefit you.
|
44 |
- ***What is the model format?*** We use safetensors.
|
@@ -52,18 +52,18 @@ tags:
|
|
52 |
|
53 |
You can run the smashed model with these steps:
|
54 |
|
55 |
-
0. Check requirements from the original repo
|
56 |
1. Make sure that you have installed quantization related packages.
|
57 |
```bash
|
58 |
-
|
59 |
```
|
60 |
2. Load & run the model.
|
61 |
```python
|
62 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
63 |
-
|
64 |
|
65 |
-
|
66 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
67 |
|
68 |
input_ids = tokenizer("What is the color of prunes?,", return_tensors='pt').to(model.device)["input_ids"]
|
69 |
|
@@ -77,7 +77,7 @@ The configuration info are in `smash_config.json`.
|
|
77 |
|
78 |
## Credits & License
|
79 |
|
80 |
-
The license of the smashed model follows the license of the original model. Please check the license of the original model
|
81 |
|
82 |
## Want to compress other models?
|
83 |
|
|
|
1 |
---
|
2 |
thumbnail: "https://assets-global.website-files.com/646b351987a8d8ce158d1940/64ec9e96b4334c0e1ac41504_Logo%20with%20white%20text.svg"
|
3 |
+
base_model: google/codegemma-2b
|
4 |
metrics:
|
5 |
- memory_disk
|
6 |
- memory_inference
|
|
|
31 |
- Contact us and tell us which model to compress next [here](https://www.pruna.ai/contact).
|
32 |
- Request access to easily compress your *own* AI models [here](https://z0halsaff74.typeform.com/pruna-access?typeform-source=www.pruna.ai).
|
33 |
- Read the documentations to know more [here](https://pruna-ai-pruna.readthedocs-hosted.com/en/latest/)
|
34 |
+
- Join Pruna AI community on Discord [here](https://discord.gg/CP4VSgck) to share feedback/suggestions or get help.
|
35 |
|
36 |
## Results
|
37 |
|
38 |
![image info](./plots.png)
|
39 |
|
40 |
**Frequently Asked Questions**
|
41 |
+
- ***How does the compression work?*** The model is compressed with awq.
|
42 |
- ***How does the model quality change?*** The quality of the model output might vary compared to the base model.
|
43 |
- ***How is the model efficiency evaluated?*** These results were obtained on HARDWARE_NAME with configuration described in `model/smash_config.json` and are obtained after a hardware warmup. The smashed model is directly compared to the original base model. Efficiency results may vary in other settings (e.g. other hardware, image size, batch size, ...). We recommend to directly run them in the use-case conditions to know if the smashed model can benefit you.
|
44 |
- ***What is the model format?*** We use safetensors.
|
|
|
52 |
|
53 |
You can run the smashed model with these steps:
|
54 |
|
55 |
+
0. Check requirements from the original repo google/codegemma-2b installed. In particular, check python, cuda, and transformers versions.
|
56 |
1. Make sure that you have installed quantization related packages.
|
57 |
```bash
|
58 |
+
pip install autoawq
|
59 |
```
|
60 |
2. Load & run the model.
|
61 |
```python
|
62 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
63 |
+
from awq import AutoAWQForCausalLM
|
64 |
|
65 |
+
model = AutoAWQForCausalLM.from_quantized("PrunaAI/google-codegemma-2b-AWQ-4bit-smashed", trust_remote_code=True, device_map='auto')
|
66 |
+
tokenizer = AutoTokenizer.from_pretrained("google/codegemma-2b")
|
67 |
|
68 |
input_ids = tokenizer("What is the color of prunes?,", return_tensors='pt').to(model.device)["input_ids"]
|
69 |
|
|
|
77 |
|
78 |
## Credits & License
|
79 |
|
80 |
+
The license of the smashed model follows the license of the original model. Please check the license of the original model google/codegemma-2b before using this model which provided the base model. The license of the `pruna-engine` is [here](https://pypi.org/project/pruna-engine/) on Pypi.
|
81 |
|
82 |
## Want to compress other models?
|
83 |
|
config.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
{
|
2 |
-
"_name_or_path": "/
|
3 |
"architectures": [
|
4 |
"GemmaForCausalLM"
|
5 |
],
|
@@ -9,7 +9,7 @@
|
|
9 |
"eos_token_id": 1,
|
10 |
"head_dim": 256,
|
11 |
"hidden_act": "gelu",
|
12 |
-
"hidden_activation":
|
13 |
"hidden_size": 2048,
|
14 |
"initializer_range": 0.02,
|
15 |
"intermediate_size": 16384,
|
@@ -30,7 +30,7 @@
|
|
30 |
"rms_norm_eps": 1e-06,
|
31 |
"rope_theta": 10000.0,
|
32 |
"torch_dtype": "float16",
|
33 |
-
"transformers_version": "4.
|
34 |
"use_cache": false,
|
35 |
"vocab_size": 256000
|
36 |
}
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "/ceph/hdd/staff/charpent/.cache/modelsetdbiq3q_h9nth96",
|
3 |
"architectures": [
|
4 |
"GemmaForCausalLM"
|
5 |
],
|
|
|
9 |
"eos_token_id": 1,
|
10 |
"head_dim": 256,
|
11 |
"hidden_act": "gelu",
|
12 |
+
"hidden_activation": "gelu_pytorch_tanh",
|
13 |
"hidden_size": 2048,
|
14 |
"initializer_range": 0.02,
|
15 |
"intermediate_size": 16384,
|
|
|
30 |
"rms_norm_eps": 1e-06,
|
31 |
"rope_theta": 10000.0,
|
32 |
"torch_dtype": "float16",
|
33 |
+
"transformers_version": "4.42.4",
|
34 |
"use_cache": false,
|
35 |
"vocab_size": 256000
|
36 |
}
|
generation_config.json
CHANGED
@@ -4,5 +4,5 @@
|
|
4 |
"do_sample": true,
|
5 |
"eos_token_id": 1,
|
6 |
"pad_token_id": 0,
|
7 |
-
"transformers_version": "4.
|
8 |
}
|
|
|
4 |
"do_sample": true,
|
5 |
"eos_token_id": 1,
|
6 |
"pad_token_id": 0,
|
7 |
+
"transformers_version": "4.42.4"
|
8 |
}
|
model.safetensors
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 3126961840
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5f9bb87cd20d69be8f669e07ea92fb9b90e95288ad99c7a5bb7d3eb4a74d6afc
|
3 |
size 3126961840
|
smash_config.json
CHANGED
@@ -14,7 +14,7 @@
|
|
14 |
"controlnet": "None",
|
15 |
"unet_dim": 4,
|
16 |
"device": "cuda",
|
17 |
-
"cache_dir": "/ceph/hdd/staff/charpent/.cache/
|
18 |
"batch_size": 1,
|
19 |
"model_name": "google/codegemma-2b",
|
20 |
"task": "text_text_generation",
|
|
|
14 |
"controlnet": "None",
|
15 |
"unet_dim": 4,
|
16 |
"device": "cuda",
|
17 |
+
"cache_dir": "/ceph/hdd/staff/charpent/.cache/modelsetdbiq3q",
|
18 |
"batch_size": 1,
|
19 |
"model_name": "google/codegemma-2b",
|
20 |
"task": "text_text_generation",
|