sharpenb commited on
Commit
c422d23
1 Parent(s): a3753ce

Upload folder using huggingface_hub (#4)

Browse files

- 90f87707d67ece533cfcbda5938891405d4d7e77a683a12071668e36ec79dabb (db5df2ed48b7c75fea0baf4fc49275ab8381465b)
- b5bb903ffe71a72ef929760eb29747a1fc3e661fb9b0c272ef4ab0b48e23518d (64a38f7f89040075d60b4ab2126bbb6386e89183)

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
@@ -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 NVIDIA A100-PCIE-40GB 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.
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
- model = AutoModelForCausalLM.from_pretrained("PrunaAI/openchat-openchat_3.5-bnb-4bit-smashed",
64
- trust_remote_code=True, device_map='auto')
65
- tokenizer = AutoTokenizer.from_pretrained("openchat/openchat_3.5")
66
 
67
- input_ids = tokenizer("What is the color of prunes?,", return_tensors='pt').to(model.device)["input_ids"]
68
 
69
- outputs = model.generate(input_ids, max_new_tokens=216)
70
- tokenizer.decode(outputs[0])
71
  ```
72
 
73
  ## Configurations
 
1
  ---
2
  thumbnail: "https://assets-global.website-files.com/646b351987a8d8ce158d1940/64ec9e96b4334c0e1ac41504_Logo%20with%20white%20text.svg"
3
+ base_model: openchat/openchat_3.5
4
  metrics:
5
  - memory_disk
6
  - memory_inference
 
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/openchat-openchat_3.5-bnb-4bit-smashed", trust_remote_code=True, device_map='auto')
66
+ tokenizer = AutoTokenizer.from_pretrained("openchat/openchat_3.5")
 
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
added_tokens.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "<|end_of_turn|>": 32000,
3
+ "<|pad_0|>": 32001
4
+ }
config.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "_name_or_path": "/tmp/tmp51g1_rii",
3
  "architectures": [
4
  "MistralForCausalLM"
5
  ],
@@ -16,7 +16,10 @@
16
  "num_hidden_layers": 32,
17
  "num_key_value_heads": 8,
18
  "quantization_config": {
 
 
19
  "bnb_4bit_compute_dtype": "bfloat16",
 
20
  "bnb_4bit_quant_type": "fp4",
21
  "bnb_4bit_use_double_quant": false,
22
  "llm_int8_enable_fp32_cpu_offload": false,
@@ -34,7 +37,7 @@
34
  "sliding_window": 4096,
35
  "tie_word_embeddings": false,
36
  "torch_dtype": "float16",
37
- "transformers_version": "4.37.1",
38
  "use_cache": true,
39
  "vocab_size": 32002
40
  }
 
1
  {
2
+ "_name_or_path": "/ceph/hdd/staff/charpent/.cache/models7vlglxrtt2otw5rz",
3
  "architectures": [
4
  "MistralForCausalLM"
5
  ],
 
16
  "num_hidden_layers": 32,
17
  "num_key_value_heads": 8,
18
  "quantization_config": {
19
+ "_load_in_4bit": true,
20
+ "_load_in_8bit": false,
21
  "bnb_4bit_compute_dtype": "bfloat16",
22
+ "bnb_4bit_quant_storage": "uint8",
23
  "bnb_4bit_quant_type": "fp4",
24
  "bnb_4bit_use_double_quant": false,
25
  "llm_int8_enable_fp32_cpu_offload": false,
 
37
  "sliding_window": 4096,
38
  "tie_word_embeddings": false,
39
  "torch_dtype": "float16",
40
+ "transformers_version": "4.40.0",
41
  "use_cache": true,
42
  "vocab_size": 32002
43
  }
generation_config.json CHANGED
@@ -5,5 +5,5 @@
5
  "max_length": 8192,
6
  "pad_token_id": 0,
7
  "temperature": 0.5,
8
- "transformers_version": "4.37.1"
9
  }
 
5
  "max_length": 8192,
6
  "pad_token_id": 0,
7
  "temperature": 0.5,
8
+ "transformers_version": "4.40.0"
9
  }
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
- "task": "text_text_generation",
 
 
 
10
  "device": "cuda",
11
- "cache_dir": "/ceph/hdd/staff/charpent/.cache/modelssz3idgim",
12
  "batch_size": 1,
13
  "model_name": "openchat/openchat_3.5",
14
- "pruning_ratio": 0.0,
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/models7vlglxrt",
18
  "batch_size": 1,
19
  "model_name": "openchat/openchat_3.5",
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,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|end_of_turn|>",
4
+ "<|pad_0|>"
5
+ ],
6
+ "bos_token": {
7
+ "content": "<s>",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false
12
+ },
13
+ "eos_token": {
14
+ "content": "<|end_of_turn|>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false
19
+ },
20
+ "unk_token": {
21
+ "content": "<unk>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false
26
+ }
27
+ }
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:dadfd56d766715c61d2ef780a525ab43b8e6da4de6865bda3d95fdef5e134055
3
+ size 493443
tokenizer_config.json ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "added_tokens_decoder": {
5
+ "0": {
6
+ "content": "<unk>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "1": {
14
+ "content": "<s>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "2": {
22
+ "content": "</s>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ },
29
+ "32000": {
30
+ "content": "<|end_of_turn|>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "32001": {
38
+ "content": "<|pad_0|>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ }
45
+ },
46
+ "additional_special_tokens": [
47
+ "<|end_of_turn|>",
48
+ "<|pad_0|>"
49
+ ],
50
+ "bos_token": "<s>",
51
+ "chat_template": "{{ bos_token }}{% for message in messages %}{{ 'GPT4 Correct ' + message['role'].title() + ': ' + message['content'] + '<|end_of_turn|>'}}{% endfor %}{% if add_generation_prompt %}{{ 'GPT4 Correct Assistant:' }}{% endif %}",
52
+ "clean_up_tokenization_spaces": false,
53
+ "eos_token": "<|end_of_turn|>",
54
+ "legacy": false,
55
+ "model_max_length": 1000000000000000019884624838656,
56
+ "pad_token": null,
57
+ "sp_model_kwargs": {},
58
+ "spaces_between_special_tokens": false,
59
+ "tokenizer_class": "LlamaTokenizer",
60
+ "unk_token": "<unk>",
61
+ "use_default_system_prompt": true
62
+ }