sylwia-kuros commited on
Commit
b83ec29
1 Parent(s): 73305a3

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +68 -0
README.md ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ ---
4
+
5
+ # mpt-7b-int4-ov
6
+
7
+ * Model creator: [Mosaic ML, Inc.](https://huggingface.co/mosaicml)
8
+ * Original model: [mosaicml/mpt-7b-instruct](https://huggingface.co/mosaicml/mpt-7b-instruct)
9
+
10
+ ## Description
11
+
12
+ This is [mosaicml/mpt-7b-instruct](https://huggingface.co/mosaicml/mpt-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)..
13
+
14
+ ## Quantization Parameters
15
+
16
+ Weight compression was performed using `nncf.compress_weights` with the following parameters:
17
+ * mode: **INT4_SYM**
18
+ * group_size: **128**
19
+ * ratio: **1.0**
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/mpt-7b-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](https://huggingface.co/mosaicml/mpt-7b-instruct).
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 [mosaicml/mpt-7b-instruct](https://huggingface.co/mosaicml/mpt-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.