openvino-ci commited on
Commit
5d6420d
1 Parent(s): 0013bd5

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ license_link: https://choosealicense.com/licenses/apache-2.0/
4
+ ---
5
+ # falcon-7b-instruct-int4-ov
6
+ * Model creator: [Tiiuae](https://huggingface.co/tiiuae)
7
+ * Original model: [falcon-7b-instruct](https://huggingface.co/tiiuae/falcon-7b-instruct)
8
+
9
+ ## Description
10
+ This is [falcon-7b-instruct](https://huggingface.co/tiiuae/falcon-7b-instruct) model converted to the [OpenVINO™ IR](https://docs.openvino.ai/2024/documentation/openvino-ir-format.html) (Intermediate Representation) format with weights compressed to INT4 by [NNCF](https://github.com/openvinotoolkit/nncf).
11
+
12
+ ## Quantization Parameters
13
+
14
+ Weight compression was performed using `nncf.compress_weights` with the following parameters:
15
+
16
+ * mode: **int4_sym**
17
+ * ratio: **1.0**
18
+ * group_size: **64**
19
+ * all_layers: **True**
20
+
21
+ For more information on quantization, check the [OpenVINO model optimization guide](https://docs.openvino.ai/2024/openvino-workflow/model-optimization-guide/weight-compression.html).
22
+
23
+
24
+ ## Compatibility
25
+
26
+ The provided OpenVINO™ IR model is compatible with:
27
+
28
+ * OpenVINO version 2024.1.0 and higher
29
+ * Optimum Intel 1.16.0 and higher
30
+
31
+ ## Running Model Inference
32
+
33
+ 1. Install packages required for using [Optimum Intel](https://huggingface.co/docs/optimum/intel/index) integration with the OpenVINO backend:
34
+
35
+ ```
36
+ pip install optimum[openvino]
37
+ ```
38
+
39
+ 2. Run model inference:
40
+
41
+ ```
42
+ from transformers import AutoTokenizer
43
+ from optimum.intel.openvino import OVModelForCausalLM
44
+
45
+ model_id = "OpenVINO/falcon-7b-instruct-int4-ov"
46
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
47
+ model = OVModelForCausalLM.from_pretrained(model_id)
48
+
49
+ inputs = tokenizer("What is OpenVINO?", return_tensors="pt")
50
+
51
+ outputs = model.generate(**inputs, max_length=200)
52
+ text = tokenizer.batch_decode(outputs)[0]
53
+ print(text)
54
+ ```
55
+
56
+ For more examples and possible optimizations, refer to the [OpenVINO Large Language Model Inference Guide](https://docs.openvino.ai/2024/learn-openvino/llm_inference_guide.html).
57
+
58
+ ## Limitations
59
+
60
+ Check the original model card for [limitations]().
61
+
62
+ ## Legal information
63
+
64
+ The original model is distributed under [apache-2.0](https://choosealicense.com/licenses/apache-2.0/) license. More details can be found in [original model card](https://huggingface.co/tiiuae/falcon-7b-instruct).
65
+
66
+ ## Disclaimer
67
+
68
+ Intel is committed to respecting human rights and avoiding causing or contributing to adverse impacts on human rights. See [Intel’s Global Human Rights Principles](https://www.intel.com/content/dam/www/central-libraries/us/en/documents/policy-human-rights.pdf). Intel’s products and software are intended only to be used in applications that do not cause or contribute to adverse impacts on human rights.
config.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "tiiuae/falcon-7b-instruct",
3
+ "activation": "gelu",
4
+ "alibi": false,
5
+ "apply_residual_connection_post_layernorm": false,
6
+ "architectures": [
7
+ "FalconForCausalLM"
8
+ ],
9
+ "attention_dropout": 0.0,
10
+ "auto_map": {
11
+ "AutoConfig": "configuration_falcon.FalconConfig",
12
+ "AutoModel": "modeling_falcon.FalconModel",
13
+ "AutoModelForCausalLM": "modeling_falcon.FalconForCausalLM",
14
+ "AutoModelForQuestionAnswering": "modeling_falcon.FalconForQuestionAnswering",
15
+ "AutoModelForSequenceClassification": "modeling_falcon.FalconForSequenceClassification",
16
+ "AutoModelForTokenClassification": "modeling_falcon.FalconForTokenClassification"
17
+ },
18
+ "bias": false,
19
+ "bos_token_id": 11,
20
+ "eos_token_id": 11,
21
+ "ffn_hidden_size": 18176,
22
+ "hidden_dropout": 0.0,
23
+ "hidden_size": 4544,
24
+ "initializer_range": 0.02,
25
+ "layer_norm_epsilon": 1e-05,
26
+ "max_position_embeddings": 2048,
27
+ "model_type": "falcon",
28
+ "multi_query": true,
29
+ "new_decoder_architecture": false,
30
+ "num_attention_heads": 71,
31
+ "num_hidden_layers": 32,
32
+ "num_kv_heads": 71,
33
+ "num_ln_in_parallel_attn": null,
34
+ "parallel_attn": true,
35
+ "rope_scaling": null,
36
+ "rope_theta": 10000.0,
37
+ "transformers_version": "4.41.2",
38
+ "use_cache": true,
39
+ "vocab_size": 65024
40
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": 2,
5
+ "transformers_version": "4.41.2"
6
+ }
openvino_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8333c47cbe745a78f8e5449c422f4a6947b67c95c7f92f27e5569477d4b0d8fc
3
+ size 3679253536
openvino_model.xml ADDED
The diff for this file is too large to render. See raw diff
 
special_tokens_map.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ ">>TITLE<<",
4
+ ">>ABSTRACT<<",
5
+ ">>INTRODUCTION<<",
6
+ ">>SUMMARY<<",
7
+ ">>COMMENT<<",
8
+ ">>ANSWER<<",
9
+ ">>QUESTION<<",
10
+ ">>DOMAIN<<",
11
+ ">>PREFIX<<",
12
+ ">>SUFFIX<<",
13
+ ">>MIDDLE<<"
14
+ ],
15
+ "eos_token": {
16
+ "content": "<|endoftext|>",
17
+ "lstrip": false,
18
+ "normalized": false,
19
+ "rstrip": false,
20
+ "single_word": false
21
+ }
22
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "0": {
5
+ "content": ">>TITLE<<",
6
+ "lstrip": false,
7
+ "normalized": false,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "1": {
13
+ "content": ">>ABSTRACT<<",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "2": {
21
+ "content": ">>INTRODUCTION<<",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "3": {
29
+ "content": ">>SUMMARY<<",
30
+ "lstrip": false,
31
+ "normalized": false,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "4": {
37
+ "content": ">>COMMENT<<",
38
+ "lstrip": false,
39
+ "normalized": false,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ },
44
+ "5": {
45
+ "content": ">>ANSWER<<",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false,
50
+ "special": true
51
+ },
52
+ "6": {
53
+ "content": ">>QUESTION<<",
54
+ "lstrip": false,
55
+ "normalized": false,
56
+ "rstrip": false,
57
+ "single_word": false,
58
+ "special": true
59
+ },
60
+ "7": {
61
+ "content": ">>DOMAIN<<",
62
+ "lstrip": false,
63
+ "normalized": false,
64
+ "rstrip": false,
65
+ "single_word": false,
66
+ "special": true
67
+ },
68
+ "8": {
69
+ "content": ">>PREFIX<<",
70
+ "lstrip": false,
71
+ "normalized": false,
72
+ "rstrip": false,
73
+ "single_word": false,
74
+ "special": true
75
+ },
76
+ "9": {
77
+ "content": ">>SUFFIX<<",
78
+ "lstrip": false,
79
+ "normalized": false,
80
+ "rstrip": false,
81
+ "single_word": false,
82
+ "special": true
83
+ },
84
+ "10": {
85
+ "content": ">>MIDDLE<<",
86
+ "lstrip": false,
87
+ "normalized": false,
88
+ "rstrip": false,
89
+ "single_word": false,
90
+ "special": true
91
+ },
92
+ "11": {
93
+ "content": "<|endoftext|>",
94
+ "lstrip": false,
95
+ "normalized": false,
96
+ "rstrip": false,
97
+ "single_word": false,
98
+ "special": true
99
+ }
100
+ },
101
+ "additional_special_tokens": [
102
+ ">>TITLE<<",
103
+ ">>ABSTRACT<<",
104
+ ">>INTRODUCTION<<",
105
+ ">>SUMMARY<<",
106
+ ">>COMMENT<<",
107
+ ">>ANSWER<<",
108
+ ">>QUESTION<<",
109
+ ">>DOMAIN<<",
110
+ ">>PREFIX<<",
111
+ ">>SUFFIX<<",
112
+ ">>MIDDLE<<"
113
+ ],
114
+ "clean_up_tokenization_spaces": true,
115
+ "eos_token": "<|endoftext|>",
116
+ "model_max_length": 2048,
117
+ "tokenizer_class": "PreTrainedTokenizerFast"
118
+ }