sylwia-kuros
commited on
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
---
|
4 |
+
|
5 |
+
<!-- Model name used as model card title -->
|
6 |
+
# TinyLlama-1.1B-Chat-v1.0-int8-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 INT8 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: **INT8_ASYM**
|
23 |
+
* ratio: **1.0**
|
24 |
+
|
25 |
+
For more information on quantization, check the [OpenVINO model optimization guide](https://docs.openvino.ai/2024/openvino-workflow/model-optimization-guide/weight-compression.html).
|
26 |
+
|
27 |
+
## Compatibility
|
28 |
+
|
29 |
+
The provided OpenVINO™ IR model is compatible with:
|
30 |
+
|
31 |
+
* OpenVINO version 2024.1.0 and higher
|
32 |
+
* Optimum Intel 1.16.0 and higher
|
33 |
+
|
34 |
+
## Running Model Inference
|
35 |
+
|
36 |
+
<!-- Example model usage -->
|
37 |
+
|
38 |
+
1. Install packages required for using [Optimum Intel](https://huggingface.co/docs/optimum/intel/index) integration with the OpenVINO backend:
|
39 |
+
|
40 |
+
```
|
41 |
+
pip install optimum[openvino]
|
42 |
+
```
|
43 |
+
|
44 |
+
2. Run model inference:
|
45 |
+
|
46 |
+
<!-- Usage example can be adopted from original model usage example -->
|
47 |
+
|
48 |
+
```
|
49 |
+
from transformers import AutoTokenizer
|
50 |
+
from optimum.intel.openvino import OVModelForCausalLM
|
51 |
+
|
52 |
+
model_id = "OpenVINO/TinyLlama-1.1B-Chat-v1.0-fp16-ov"
|
53 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
54 |
+
model = OVModelForCausalLM.from_pretrained(model_id)
|
55 |
+
|
56 |
+
inputs = tokenizer("What is OpenVINO?", return_tensors="pt")
|
57 |
+
|
58 |
+
outputs = model.generate(**inputs, max_length=200)
|
59 |
+
text = tokenizer.batch_decode(outputs)[0]
|
60 |
+
print(text)
|
61 |
+
```
|
62 |
+
|
63 |
+
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).
|
64 |
+
|
65 |
+
## Legal information
|
66 |
+
|
67 |
+
<!-- Note about original model license -->
|
68 |
+
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).
|
69 |
+
|
70 |
+
## Disclaimer
|
71 |
+
|
72 |
+
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.
|