sylwia-kuros commited on
Commit
c8bf64d
·
verified ·
1 Parent(s): 89e7a32

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +73 -0
README.md ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ ---
4
+
5
+ <!-- Model name used as model card title -->
6
+ # TinyLlama-1.1B-Chat-v1.0-int4-ov
7
+ <!-- Original model reference -->
8
+ * Model creator: [TinyLlama](https://huggingface.co/TinyLlama)
9
+ * Original model: [TinyLlama/TinyLlama-1.1B-Chat-v1.0](https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0)
10
+
11
+ <!-- Description of converted model -->
12
+ ## Description
13
+
14
+ <!-- Comment and reference on NNCF applicable only for INT8 and INT4 models -->
15
+ This is [TinyLlama/TinyLlama-1.1B-Chat-v1.0](https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0) 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).
16
+
17
+ ## Quantization Parameters
18
+
19
+ Weight compression was performed using `nncf.compress_weights` with the following parameters:
20
+
21
+
22
+ * mode: **INT4_SYM**
23
+ * group_size: **128**
24
+ * ratio: **1.0**
25
+
26
+ For more information on quantization, check the [OpenVINO model optimization guide](https://docs.openvino.ai/2024/openvino-workflow/model-optimization-guide/weight-compression.html).
27
+
28
+ ## Compatibility
29
+
30
+ The provided OpenVINO™ IR model is compatible with:
31
+
32
+ * OpenVINO version 2024.1.0 and higher
33
+ * Optimum Intel 1.16.0 and higher
34
+
35
+ ## Running Model Inference
36
+
37
+ <!-- Example model usage -->
38
+
39
+ 1. Install packages required for using [Optimum Intel](https://huggingface.co/docs/optimum/intel/index) integration with the OpenVINO backend:
40
+
41
+ ```
42
+ pip install optimum[openvino]
43
+ ```
44
+
45
+ 2. Run model inference:
46
+
47
+ <!-- Usage example can be adopted from original model usage example -->
48
+
49
+ ```
50
+ from transformers import AutoTokenizer
51
+ from optimum.intel.openvino import OVModelForCausalLM
52
+
53
+ model_id = "OpenVINO/TinyLlama-1.1B-Chat-v1.0-int4-ov"
54
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
55
+ model = OVModelForCausalLM.from_pretrained(model_id)
56
+
57
+ inputs = tokenizer("What is OpenVINO?", return_tensors="pt")
58
+
59
+ outputs = model.generate(**inputs, max_length=200)
60
+ text = tokenizer.batch_decode(outputs)[0]
61
+ print(text)
62
+ ```
63
+
64
+ 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).
65
+
66
+ ## Legal information
67
+
68
+ <!-- Note about original model license -->
69
+ The original model is distributed under [apache-2.0](https://choosealicense.com/licenses/apache-2.0/) license. More details can be found in [TinyLlama/TinyLlama-1.1B-Chat-v1.0](https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0).
70
+
71
+ ## Disclaimer
72
+
73
+ 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.