Update README.md
Browse files
README.md
CHANGED
@@ -23,10 +23,12 @@ For more information on quantization, check the [OpenVINO model optimization gui
|
|
23 |
|
24 |
The provided OpenVINO™ IR model is compatible with:
|
25 |
|
26 |
-
* OpenVINO version 2024.
|
27 |
-
* Optimum Intel 1.
|
28 |
|
29 |
-
|
|
|
|
|
30 |
|
31 |
1. Install packages required for using [Optimum Intel](https://huggingface.co/docs/optimum/intel/index) integration with the OpenVINO backend:
|
32 |
|
@@ -36,6 +38,8 @@ pip install optimum[openvino]
|
|
36 |
|
37 |
2. Run model inference:
|
38 |
|
|
|
|
|
39 |
```
|
40 |
from transformers import AutoTokenizer
|
41 |
from optimum.intel.openvino import OVModelForCausalLM
|
@@ -53,6 +57,38 @@ print(text)
|
|
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](https://huggingface.co/EleutherAI/gpt-neox-20b#limitations-and-biases).
|
|
|
23 |
|
24 |
The provided OpenVINO™ IR model is compatible with:
|
25 |
|
26 |
+
* OpenVINO version 2024.2.0 and higher
|
27 |
+
* Optimum Intel 1.18.0 and higher
|
28 |
|
29 |
+
# Running Model Inference with [Optimum Intel](https://huggingface.co/docs/optimum/intel/index)
|
30 |
+
|
31 |
+
<!-- Example model usage -->
|
32 |
|
33 |
1. Install packages required for using [Optimum Intel](https://huggingface.co/docs/optimum/intel/index) integration with the OpenVINO backend:
|
34 |
|
|
|
38 |
|
39 |
2. Run model inference:
|
40 |
|
41 |
+
<!-- Usage example can be adopted from original model usage example -->
|
42 |
+
|
43 |
```
|
44 |
from transformers import AutoTokenizer
|
45 |
from optimum.intel.openvino import OVModelForCausalLM
|
|
|
57 |
|
58 |
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).
|
59 |
|
60 |
+
<!-- Usage example with OpenVINO GenAI if applicable -->
|
61 |
+
## Running Model Inference with [OpenVINO GenAI](https://github.com/openvinotoolkit/openvino.genai)
|
62 |
+
|
63 |
+
1. Install packages required for using OpenVINO GenAI.
|
64 |
+
```
|
65 |
+
pip install openvino-genai huggingface_hub
|
66 |
+
```
|
67 |
+
|
68 |
+
2. Download model from HuggingFace Hub
|
69 |
+
|
70 |
+
```
|
71 |
+
import huggingface_hub as hf_hub
|
72 |
+
|
73 |
+
model_id = "OpenVINO/gpt-neox-20b-int8-ov"
|
74 |
+
model_path = "gpt-neox-20b-int8-ov"
|
75 |
+
|
76 |
+
hf_hub.snapshot_download(model_id, local_dir=model_path)
|
77 |
+
|
78 |
+
```
|
79 |
+
|
80 |
+
3. Run model inference:
|
81 |
+
|
82 |
+
```
|
83 |
+
import openvino_genai as ov_genai
|
84 |
+
|
85 |
+
device = "CPU"
|
86 |
+
pipe = ov_genai.LLMPipeline(model_path, device)
|
87 |
+
print(pipe.generate("What is OpenVINO?"))
|
88 |
+
```
|
89 |
+
|
90 |
+
More GenAI usage examples can be found in OpenVINO GenAI library [docs](https://github.com/openvinotoolkit/openvino.genai/blob/master/src/README.md) and [samples](https://github.com/openvinotoolkit/openvino.genai?tab=readme-ov-file#openvino-genai-samples)
|
91 |
+
|
92 |
## Limitations
|
93 |
|
94 |
Check the original model card for [limitations](https://huggingface.co/EleutherAI/gpt-neox-20b#limitations-and-biases).
|