sylwia-kuros
commited on
Commit
•
277dfcb
1
Parent(s):
4d64a6d
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
language:
|
4 |
+
- en
|
5 |
+
---
|
6 |
+
|
7 |
+
# dolly-v2-3b-int4-ov
|
8 |
+
|
9 |
+
* Model creator: [Databricks](https://huggingface.co/databricks)
|
10 |
+
* Original model: [dolly-v2-3b](https://huggingface.co/databricks/dolly-v2-3b)
|
11 |
+
|
12 |
+
## Description
|
13 |
+
|
14 |
+
This is [dolly-v2-3b](https://huggingface.co/databricks/dolly-v2-3b) 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).
|
15 |
+
|
16 |
+
## Quantization Parameters
|
17 |
+
|
18 |
+
Weight compression was performed using `nncf.compress_weights` with the following parameters:
|
19 |
+
|
20 |
+
* mode: **INT4_ASYM**
|
21 |
+
* group_size: **32**
|
22 |
+
* ratio: **0.5**
|
23 |
+
* sensitivity_metric: **weight_quantization_error**
|
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 |
+
1. Install packages required for using [Optimum Intel](https://huggingface.co/docs/optimum/intel/index) integration with the OpenVINO backend:
|
37 |
+
|
38 |
+
```
|
39 |
+
pip install optimum[openvino]
|
40 |
+
```
|
41 |
+
|
42 |
+
2. Run model inference:
|
43 |
+
|
44 |
+
```
|
45 |
+
from transformers import AutoTokenizer
|
46 |
+
from optimum.intel.openvino import OVModelForCausalLM
|
47 |
+
|
48 |
+
model_id = "OpenVINO/dolly-v2-3b-int4-ov"
|
49 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
50 |
+
model = OVModelForCausalLM.from_pretrained(model_id)
|
51 |
+
|
52 |
+
inputs = tokenizer("What is OpenVINO?", return_tensors="pt")
|
53 |
+
|
54 |
+
outputs = model.generate(**inputs, max_length=200)
|
55 |
+
text = tokenizer.batch_decode(outputs)[0]
|
56 |
+
print(text)
|
57 |
+
```
|
58 |
+
|
59 |
+
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).
|
60 |
+
|
61 |
+
## Limitations
|
62 |
+
|
63 |
+
Check the original model card for [limitations](https://huggingface.co/databricks/dolly-v2-3b#known-limitations).
|
64 |
+
|
65 |
+
## Legal information
|
66 |
+
|
67 |
+
The original model is distributed under mit license. More details can be found in [original model card](https://huggingface.co/databricks/dolly-v2-3b).
|