Upload folder using huggingface_hub (#4)
Browse files- 7bf983626987fd827249e27365f35f18350daba21fad658bbed71703d0b83f16 (733416c71a23eabd015775fbee17565ce71728c7)
- 6bae263d737d65543379eae45ad21f7611016d1b17f0407c62d4a0b6de839024 (02881bb0250eb0252512117799629d2c02aa1497)
- README.md +14 -10
- config.json +0 -28
- 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,22 @@ 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 |
-
|
|
|
|
|
|
|
|
|
67 |
|
68 |
input_ids = tokenizer("What is the color of prunes?,", return_tensors='pt').to(model.device)["input_ids"]
|
69 |
|
@@ -77,7 +81,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: cognitivecomputations/dolphin-2.9-llama3-8b
|
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 hqq.
|
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 cognitivecomputations/dolphin-2.9-llama3-8b 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 hqq
|
59 |
```
|
60 |
2. Load & run the model.
|
61 |
```python
|
62 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
63 |
+
from hqq.engine.hf import HQQModelForCausalLM
|
64 |
+
from hqq.models.hf.base import AutoHQQHFModel
|
65 |
+
|
66 |
+
try:
|
67 |
+
model = HQQModelForCausalLM.from_quantized("PrunaAI/cognitivecomputations-dolphin-2.9-llama3-8b-HQQ-4bit-smashed", device_map='auto')
|
68 |
+
except:
|
69 |
+
model = AutoHQQHFModel.from_quantized("PrunaAI/cognitivecomputations-dolphin-2.9-llama3-8b-HQQ-4bit-smashed")
|
70 |
+
tokenizer = AutoTokenizer.from_pretrained("cognitivecomputations/dolphin-2.9-llama3-8b")
|
71 |
|
72 |
input_ids = tokenizer("What is the color of prunes?,", return_tensors='pt').to(model.device)["input_ids"]
|
73 |
|
|
|
81 |
|
82 |
## Credits & License
|
83 |
|
84 |
+
The license of the smashed model follows the license of the original model. Please check the license of the original model cognitivecomputations/dolphin-2.9-llama3-8b 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.
|
85 |
|
86 |
## Want to compress other models?
|
87 |
|
config.json
CHANGED
@@ -1,28 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"_name_or_path": "cognitivecomputations/dolphin-2.9-llama3-8b",
|
3 |
-
"architectures": [
|
4 |
-
"LlamaForCausalLM"
|
5 |
-
],
|
6 |
-
"attention_bias": false,
|
7 |
-
"attention_dropout": 0.0,
|
8 |
-
"bos_token_id": 128000,
|
9 |
-
"eos_token_id": 128256,
|
10 |
-
"hidden_act": "silu",
|
11 |
-
"hidden_size": 4096,
|
12 |
-
"initializer_range": 0.02,
|
13 |
-
"intermediate_size": 14336,
|
14 |
-
"max_position_embeddings": 8192,
|
15 |
-
"model_type": "llama",
|
16 |
-
"num_attention_heads": 32,
|
17 |
-
"num_hidden_layers": 32,
|
18 |
-
"num_key_value_heads": 8,
|
19 |
-
"pretraining_tp": 1,
|
20 |
-
"rms_norm_eps": 1e-05,
|
21 |
-
"rope_scaling": null,
|
22 |
-
"rope_theta": 500000.0,
|
23 |
-
"tie_word_embeddings": false,
|
24 |
-
"torch_dtype": "bfloat16",
|
25 |
-
"transformers_version": "4.40.0",
|
26 |
-
"use_cache": false,
|
27 |
-
"vocab_size": 128258
|
28 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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": "cognitivecomputations/dolphin-2.9-llama3-8b",
|
20 |
"task": "text_text_generation",
|
|
|
14 |
"controlnet": "None",
|
15 |
"unet_dim": 4,
|
16 |
"device": "cuda",
|
17 |
+
"cache_dir": "/ceph/hdd/staff/charpent/.cache/models3ectmmr_",
|
18 |
"batch_size": 1,
|
19 |
"model_name": "cognitivecomputations/dolphin-2.9-llama3-8b",
|
20 |
"task": "text_text_generation",
|