Upload folder using huggingface_hub (#3)
Browse files- 4022c080fd105743dfb495acfc571861c3519e286768a25c44f771806d4390d3 (6eeb4707e78a13cd96ef0dc26156267b228b24c6)
- 698fa44e2bde89c46d196df5e69d8ce71074376c000441220301f6ceaa532f8d (89d1cdde57dc75280679887114317061a9cce2cf)
- README.md +9 -8
- config.json +6 -2
- generation_config.json +1 -1
- smash_config.json +9 -5
- special_tokens_map.json +23 -0
- tokenizer.json +0 -0
- tokenizer.model +3 -0
- tokenizer_config.json +41 -0
README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
---
|
2 |
thumbnail: "https://assets-global.website-files.com/646b351987a8d8ce158d1940/64ec9e96b4334c0e1ac41504_Logo%20with%20white%20text.svg"
|
|
|
3 |
metrics:
|
4 |
- memory_disk
|
5 |
- memory_inference
|
@@ -30,7 +31,7 @@ tags:
|
|
30 |
- Contact us and tell us which model to compress next [here](https://www.pruna.ai/contact).
|
31 |
- Request access to easily compress your *own* AI models [here](https://z0halsaff74.typeform.com/pruna-access?typeform-source=www.pruna.ai).
|
32 |
- Read the documentations to know more [here](https://pruna-ai-pruna.readthedocs-hosted.com/en/latest/)
|
33 |
-
- Join Pruna AI community on Discord [here](https://discord.gg/
|
34 |
|
35 |
## Results
|
36 |
|
@@ -39,7 +40,7 @@ tags:
|
|
39 |
**Frequently Asked Questions**
|
40 |
- ***How does the compression work?*** The model is compressed with llm-int8.
|
41 |
- ***How does the model quality change?*** The quality of the model output might vary compared to the base model.
|
42 |
-
- ***How is the model efficiency evaluated?*** These results were obtained on
|
43 |
- ***What is the model format?*** We use safetensors.
|
44 |
- ***What calibration data has been used?*** If needed by the compression method, we used WikiText as the calibration data.
|
45 |
- ***What is the naming convention for Pruna Huggingface models?*** We take the original model name and append "turbo", "tiny", or "green" if the smashed model has a measured inference speed, inference memory, or inference energy consumption which is less than 90% of the original base model.
|
@@ -59,15 +60,15 @@ You can run the smashed model with these steps:
|
|
59 |
2. Load & run the model.
|
60 |
```python
|
61 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
62 |
|
63 |
-
|
64 |
-
|
65 |
-
tokenizer = AutoTokenizer.from_pretrained("pankajmathur/orca_mini_v3_7b")
|
66 |
|
67 |
-
|
68 |
|
69 |
-
|
70 |
-
|
71 |
```
|
72 |
|
73 |
## Configurations
|
|
|
1 |
---
|
2 |
thumbnail: "https://assets-global.website-files.com/646b351987a8d8ce158d1940/64ec9e96b4334c0e1ac41504_Logo%20with%20white%20text.svg"
|
3 |
+
base_model: pankajmathur/orca_mini_v3_7b
|
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 |
|
|
|
40 |
**Frequently Asked Questions**
|
41 |
- ***How does the compression work?*** The model is compressed with llm-int8.
|
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.
|
45 |
- ***What calibration data has been used?*** If needed by the compression method, we used WikiText as the calibration data.
|
46 |
- ***What is the naming convention for Pruna Huggingface models?*** We take the original model name and append "turbo", "tiny", or "green" if the smashed model has a measured inference speed, inference memory, or inference energy consumption which is less than 90% of the original base model.
|
|
|
60 |
2. Load & run the model.
|
61 |
```python
|
62 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
63 |
+
|
64 |
|
65 |
+
model = AutoModelForCausalLM.from_pretrained("PrunaAI/pankajmathur-orca_mini_v3_7b-bnb-4bit-smashed", trust_remote_code=True, device_map='auto')
|
66 |
+
tokenizer = AutoTokenizer.from_pretrained("pankajmathur/orca_mini_v3_7b")
|
|
|
67 |
|
68 |
+
input_ids = tokenizer("What is the color of prunes?,", return_tensors='pt').to(model.device)["input_ids"]
|
69 |
|
70 |
+
outputs = model.generate(input_ids, max_new_tokens=216)
|
71 |
+
tokenizer.decode(outputs[0])
|
72 |
```
|
73 |
|
74 |
## Configurations
|
config.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
{
|
2 |
-
"_name_or_path": "/
|
3 |
"architectures": [
|
4 |
"LlamaForCausalLM"
|
5 |
],
|
@@ -12,6 +12,7 @@
|
|
12 |
"initializer_range": 0.02,
|
13 |
"intermediate_size": 11008,
|
14 |
"max_position_embeddings": 4096,
|
|
|
15 |
"model_type": "llama",
|
16 |
"num_attention_heads": 32,
|
17 |
"num_hidden_layers": 32,
|
@@ -19,7 +20,10 @@
|
|
19 |
"pad_token_id": 0,
|
20 |
"pretraining_tp": 1,
|
21 |
"quantization_config": {
|
|
|
|
|
22 |
"bnb_4bit_compute_dtype": "bfloat16",
|
|
|
23 |
"bnb_4bit_quant_type": "fp4",
|
24 |
"bnb_4bit_use_double_quant": false,
|
25 |
"llm_int8_enable_fp32_cpu_offload": false,
|
@@ -37,7 +41,7 @@
|
|
37 |
"rope_theta": 10000.0,
|
38 |
"tie_word_embeddings": false,
|
39 |
"torch_dtype": "float16",
|
40 |
-
"transformers_version": "4.
|
41 |
"use_cache": true,
|
42 |
"vocab_size": 32000
|
43 |
}
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "/ceph/hdd/staff/charpent/.cache/modelsvhjhy_f9btexonat",
|
3 |
"architectures": [
|
4 |
"LlamaForCausalLM"
|
5 |
],
|
|
|
12 |
"initializer_range": 0.02,
|
13 |
"intermediate_size": 11008,
|
14 |
"max_position_embeddings": 4096,
|
15 |
+
"mlp_bias": false,
|
16 |
"model_type": "llama",
|
17 |
"num_attention_heads": 32,
|
18 |
"num_hidden_layers": 32,
|
|
|
20 |
"pad_token_id": 0,
|
21 |
"pretraining_tp": 1,
|
22 |
"quantization_config": {
|
23 |
+
"_load_in_4bit": true,
|
24 |
+
"_load_in_8bit": false,
|
25 |
"bnb_4bit_compute_dtype": "bfloat16",
|
26 |
+
"bnb_4bit_quant_storage": "uint8",
|
27 |
"bnb_4bit_quant_type": "fp4",
|
28 |
"bnb_4bit_use_double_quant": false,
|
29 |
"llm_int8_enable_fp32_cpu_offload": false,
|
|
|
41 |
"rope_theta": 10000.0,
|
42 |
"tie_word_embeddings": false,
|
43 |
"torch_dtype": "float16",
|
44 |
+
"transformers_version": "4.42.4",
|
45 |
"use_cache": true,
|
46 |
"vocab_size": 32000
|
47 |
}
|
generation_config.json
CHANGED
@@ -3,5 +3,5 @@
|
|
3 |
"bos_token_id": 1,
|
4 |
"eos_token_id": 2,
|
5 |
"pad_token_id": 0,
|
6 |
-
"transformers_version": "4.
|
7 |
}
|
|
|
3 |
"bos_token_id": 1,
|
4 |
"eos_token_id": 2,
|
5 |
"pad_token_id": 0,
|
6 |
+
"transformers_version": "4.42.4"
|
7 |
}
|
smash_config.json
CHANGED
@@ -3,17 +3,21 @@
|
|
3 |
"verify_url": "http://johnrachwan.pythonanywhere.com",
|
4 |
"smash_config": {
|
5 |
"pruners": "None",
|
|
|
6 |
"factorizers": "None",
|
7 |
"quantizers": "['llm-int8']",
|
|
|
|
|
8 |
"compilers": "None",
|
9 |
-
"
|
|
|
|
|
|
|
10 |
"device": "cuda",
|
11 |
-
"cache_dir": "/ceph/hdd/staff/charpent/.cache/
|
12 |
"batch_size": 1,
|
13 |
"model_name": "pankajmathur/orca_mini_v3_7b",
|
14 |
-
"
|
15 |
-
"n_quantization_bits": 4,
|
16 |
-
"output_deviation": 0.005,
|
17 |
"max_batch_size": 1,
|
18 |
"qtype_weight": "torch.qint8",
|
19 |
"qtype_activation": "torch.quint8",
|
|
|
3 |
"verify_url": "http://johnrachwan.pythonanywhere.com",
|
4 |
"smash_config": {
|
5 |
"pruners": "None",
|
6 |
+
"pruning_ratio": 0.0,
|
7 |
"factorizers": "None",
|
8 |
"quantizers": "['llm-int8']",
|
9 |
+
"weight_quantization_bits": 4,
|
10 |
+
"output_deviation": 0.005,
|
11 |
"compilers": "None",
|
12 |
+
"static_batch": true,
|
13 |
+
"static_shape": true,
|
14 |
+
"controlnet": "None",
|
15 |
+
"unet_dim": 4,
|
16 |
"device": "cuda",
|
17 |
+
"cache_dir": "/ceph/hdd/staff/charpent/.cache/modelsvhjhy_f9",
|
18 |
"batch_size": 1,
|
19 |
"model_name": "pankajmathur/orca_mini_v3_7b",
|
20 |
+
"task": "text_text_generation",
|
|
|
|
|
21 |
"max_batch_size": 1,
|
22 |
"qtype_weight": "torch.qint8",
|
23 |
"qtype_activation": "torch.quint8",
|
special_tokens_map.json
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": true,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "</s>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": true,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"unk_token": {
|
17 |
+
"content": "<unk>",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": true,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
}
|
23 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
|
3 |
+
size 499723
|
tokenizer_config.json
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": true,
|
3 |
+
"add_eos_token": false,
|
4 |
+
"add_prefix_space": null,
|
5 |
+
"added_tokens_decoder": {
|
6 |
+
"0": {
|
7 |
+
"content": "<unk>",
|
8 |
+
"lstrip": false,
|
9 |
+
"normalized": true,
|
10 |
+
"rstrip": false,
|
11 |
+
"single_word": false,
|
12 |
+
"special": true
|
13 |
+
},
|
14 |
+
"1": {
|
15 |
+
"content": "<s>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": true,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false,
|
20 |
+
"special": true
|
21 |
+
},
|
22 |
+
"2": {
|
23 |
+
"content": "</s>",
|
24 |
+
"lstrip": false,
|
25 |
+
"normalized": true,
|
26 |
+
"rstrip": false,
|
27 |
+
"single_word": false,
|
28 |
+
"special": true
|
29 |
+
}
|
30 |
+
},
|
31 |
+
"bos_token": "<s>",
|
32 |
+
"clean_up_tokenization_spaces": false,
|
33 |
+
"eos_token": "</s>",
|
34 |
+
"legacy": false,
|
35 |
+
"model_max_length": 4096,
|
36 |
+
"pad_token": null,
|
37 |
+
"sp_model_kwargs": {},
|
38 |
+
"tokenizer_class": "LlamaTokenizer",
|
39 |
+
"unk_token": "<unk>",
|
40 |
+
"use_default_system_prompt": false
|
41 |
+
}
|