sharpenb commited on
Commit
1622675
1 Parent(s): c0278f0

Upload folder using huggingface_hub (#3)

Browse files

- e7a1e8c8a6b54fbb362785a002d297444f9f8b1f1602778fb8547d3e3283628f (6a11088c53aff650bd619bfbd6a3181b1f2d9f4b)
- 869dfc7a037603820cef8747dec737b1212661a1a354e3c5c73a60732cea5840 (3327679784e77d8400d87c32d867ff1e034d8185)

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/gorilla-llm-gorilla-openfunctions-v2-bnb-4bit-smashed",
64
- trust_remote_code=True, device_map='auto')
65
- tokenizer = AutoTokenizer.from_pretrained("gorilla-llm/gorilla-openfunctions-v2")
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: gorilla-llm/gorilla-openfunctions-v2
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/gorilla-llm-gorilla-openfunctions-v2-bnb-4bit-smashed", trust_remote_code=True, device_map='auto')
66
+ tokenizer = AutoTokenizer.from_pretrained("gorilla-llm/gorilla-openfunctions-v2")
 
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": "/tmp/tmprcs19ip8",
3
  "architectures": [
4
  "LlamaForCausalLM"
5
  ],
@@ -18,7 +18,10 @@
18
  "num_key_value_heads": 32,
19
  "pretraining_tp": 1,
20
  "quantization_config": {
 
 
21
  "bnb_4bit_compute_dtype": "bfloat16",
 
22
  "bnb_4bit_quant_type": "fp4",
23
  "bnb_4bit_use_double_quant": false,
24
  "llm_int8_enable_fp32_cpu_offload": false,
@@ -36,7 +39,7 @@
36
  "rope_theta": 10000.0,
37
  "tie_word_embeddings": false,
38
  "torch_dtype": "float16",
39
- "transformers_version": "4.37.1",
40
  "use_cache": false,
41
  "vocab_size": 102400
42
  }
 
1
  {
2
+ "_name_or_path": "/ceph/hdd/staff/charpent/.cache/modelsj1htoxsiakroi51z",
3
  "architectures": [
4
  "LlamaForCausalLM"
5
  ],
 
18
  "num_key_value_heads": 32,
19
  "pretraining_tp": 1,
20
  "quantization_config": {
21
+ "_load_in_4bit": true,
22
+ "_load_in_8bit": false,
23
  "bnb_4bit_compute_dtype": "bfloat16",
24
+ "bnb_4bit_quant_storage": "uint8",
25
  "bnb_4bit_quant_type": "fp4",
26
  "bnb_4bit_use_double_quant": false,
27
  "llm_int8_enable_fp32_cpu_offload": false,
 
39
  "rope_theta": 10000.0,
40
  "tie_word_embeddings": false,
41
  "torch_dtype": "float16",
42
+ "transformers_version": "4.40.0",
43
  "use_cache": false,
44
  "vocab_size": 102400
45
  }
generation_config.json CHANGED
@@ -2,5 +2,5 @@
2
  "_from_model_config": true,
3
  "bos_token_id": 100000,
4
  "eos_token_id": 100015,
5
- "transformers_version": "4.37.1"
6
  }
 
2
  "_from_model_config": true,
3
  "bos_token_id": 100000,
4
  "eos_token_id": 100015,
5
+ "transformers_version": "4.40.0"
6
  }
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/models6xhefmuy",
12
  "batch_size": 1,
13
  "model_name": "gorilla-llm/gorilla-openfunctions-v2",
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/modelsj1htoxsi",
18
  "batch_size": 1,
19
  "model_name": "gorilla-llm/gorilla-openfunctions-v2",
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": "<|begin▁of▁sentence|>",
4
+ "lstrip": false,
5
+ "normalized": true,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "<|EOT|>",
11
+ "lstrip": false,
12
+ "normalized": true,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "<|end▁of▁sentence|>",
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_config.json ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "added_tokens_decoder": {
5
+ "100000": {
6
+ "content": "<|begin▁of▁sentence|>",
7
+ "lstrip": false,
8
+ "normalized": true,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "100001": {
14
+ "content": "<|end▁of▁sentence|>",
15
+ "lstrip": false,
16
+ "normalized": true,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "100002": {
22
+ "content": "ø",
23
+ "lstrip": false,
24
+ "normalized": true,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": false
28
+ },
29
+ "100003": {
30
+ "content": "ö",
31
+ "lstrip": false,
32
+ "normalized": true,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": false
36
+ },
37
+ "100004": {
38
+ "content": "ú",
39
+ "lstrip": false,
40
+ "normalized": true,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": false
44
+ },
45
+ "100005": {
46
+ "content": "ÿ",
47
+ "lstrip": false,
48
+ "normalized": true,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": false
52
+ },
53
+ "100006": {
54
+ "content": "õ",
55
+ "lstrip": false,
56
+ "normalized": true,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": false
60
+ },
61
+ "100007": {
62
+ "content": "÷",
63
+ "lstrip": false,
64
+ "normalized": true,
65
+ "rstrip": false,
66
+ "single_word": false,
67
+ "special": false
68
+ },
69
+ "100008": {
70
+ "content": "û",
71
+ "lstrip": false,
72
+ "normalized": true,
73
+ "rstrip": false,
74
+ "single_word": false,
75
+ "special": false
76
+ },
77
+ "100009": {
78
+ "content": "ý",
79
+ "lstrip": false,
80
+ "normalized": true,
81
+ "rstrip": false,
82
+ "single_word": false,
83
+ "special": false
84
+ },
85
+ "100010": {
86
+ "content": "À",
87
+ "lstrip": false,
88
+ "normalized": true,
89
+ "rstrip": false,
90
+ "single_word": false,
91
+ "special": false
92
+ },
93
+ "100011": {
94
+ "content": "ù",
95
+ "lstrip": false,
96
+ "normalized": true,
97
+ "rstrip": false,
98
+ "single_word": false,
99
+ "special": false
100
+ },
101
+ "100012": {
102
+ "content": "Á",
103
+ "lstrip": false,
104
+ "normalized": true,
105
+ "rstrip": false,
106
+ "single_word": false,
107
+ "special": false
108
+ },
109
+ "100013": {
110
+ "content": "þ",
111
+ "lstrip": false,
112
+ "normalized": true,
113
+ "rstrip": false,
114
+ "single_word": false,
115
+ "special": false
116
+ },
117
+ "100014": {
118
+ "content": "ü",
119
+ "lstrip": false,
120
+ "normalized": true,
121
+ "rstrip": false,
122
+ "single_word": false,
123
+ "special": false
124
+ },
125
+ "100015": {
126
+ "content": "<|EOT|>",
127
+ "lstrip": false,
128
+ "normalized": true,
129
+ "rstrip": false,
130
+ "single_word": false,
131
+ "special": true
132
+ }
133
+ },
134
+ "bos_token": "<|begin▁of▁sentence|>",
135
+ "chat_template": "{% if not add_generation_prompt is defined %}\n{% set add_generation_prompt = false %}\n{% endif %}\n{%- set ns = namespace(found=false) -%}\n{%- for message in messages -%}\n {%- if message['role'] == 'system' -%}\n {%- set ns.found = true -%}\n {%- endif -%}\n{%- endfor -%}\n{{bos_token}}{%- if not ns.found -%}\n{{'You are an AI programming assistant, utilizing the Gorilla LLM model, developed by Gorilla LLM, and you only answer questions related to computer science. For politically sensitive questions, security and privacy issues, and other non-computer science questions, you will refuse to answer\\n'}}\n{%- endif %}\n{%- for message in messages %}\n {%- if message['role'] == 'system' %}\n{{ message['content'] }}\n {%- else %}\n {%- if message['role'] == 'user' %}\n{{'### Instruction:\\n' + message['content'] + '\\n'}}\n {%- else %}\n{{'### Response:\\n' + message['content'] + '\\n<|EOT|>\\n'}}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{% if add_generation_prompt %}\n{{'### Response:'}}\n{% endif %}",
136
+ "clean_up_tokenization_spaces": false,
137
+ "eos_token": "<|EOT|>",
138
+ "legacy": false,
139
+ "model_max_length": 4096,
140
+ "pad_token": "<|end▁of▁sentence|>",
141
+ "padding_side": "right",
142
+ "sp_model_kwargs": {},
143
+ "tokenizer_class": "LlamaTokenizer",
144
+ "unk_token": null,
145
+ "use_default_system_prompt": true
146
+ }