openvino-ci
commited on
Commit
•
1c43de7
1
Parent(s):
873a975
Upload folder using huggingface_hub
Browse files- README.md +66 -0
- config.json +40 -0
- generation_config.json +6 -0
- openvino_model.bin +3 -0
- openvino_model.xml +0 -0
- special_tokens_map.json +22 -0
- tokenizer.json +0 -0
- tokenizer_config.json +118 -0
README.md
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
license_link: https://choosealicense.com/licenses/apache-2.0/
|
4 |
+
---
|
5 |
+
# falcon-7b-instruct-int8-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 INT8 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: **int8_asym**
|
17 |
+
* ratio: **1**
|
18 |
+
|
19 |
+
For more information on quantization, check the [OpenVINO model optimization guide](https://docs.openvino.ai/2024/openvino-workflow/model-optimization-guide/weight-compression.html).
|
20 |
+
|
21 |
+
|
22 |
+
## Compatibility
|
23 |
+
|
24 |
+
The provided OpenVINO™ IR model is compatible with:
|
25 |
+
|
26 |
+
* OpenVINO version 2024.1.0 and higher
|
27 |
+
* Optimum Intel 1.16.0 and higher
|
28 |
+
|
29 |
+
## Running Model Inference
|
30 |
+
|
31 |
+
1. Install packages required for using [Optimum Intel](https://huggingface.co/docs/optimum/intel/index) integration with the OpenVINO backend:
|
32 |
+
|
33 |
+
```
|
34 |
+
pip install optimum[openvino]
|
35 |
+
```
|
36 |
+
|
37 |
+
2. Run model inference:
|
38 |
+
|
39 |
+
```
|
40 |
+
from transformers import AutoTokenizer
|
41 |
+
from optimum.intel.openvino import OVModelForCausalLM
|
42 |
+
|
43 |
+
model_id = "OpenVINO/falcon-7b-instruct-int8-ov"
|
44 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
45 |
+
model = OVModelForCausalLM.from_pretrained(model_id)
|
46 |
+
|
47 |
+
inputs = tokenizer("What is OpenVINO?", return_tensors="pt")
|
48 |
+
|
49 |
+
outputs = model.generate(**inputs, max_length=200)
|
50 |
+
text = tokenizer.batch_decode(outputs)[0]
|
51 |
+
print(text)
|
52 |
+
```
|
53 |
+
|
54 |
+
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).
|
55 |
+
|
56 |
+
## Limitations
|
57 |
+
|
58 |
+
Check the original model card for [limitations]().
|
59 |
+
|
60 |
+
## Legal information
|
61 |
+
|
62 |
+
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).
|
63 |
+
|
64 |
+
## Disclaimer
|
65 |
+
|
66 |
+
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:778933886dcad6ca6803f150a1263de4438fb097ca5e36482cf3702ada46c734
|
3 |
+
size 6926930384
|
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 |
+
}
|