Update README.md
Browse files
README.md
CHANGED
@@ -12,10 +12,11 @@ license_link: https://choosealicense.com/licenses/apache-2.0/
|
|
12 |
|
13 |
The provided OpenVINO™ IR model is compatible with:
|
14 |
|
15 |
-
* OpenVINO version 2024.
|
16 |
-
* Optimum Intel 1.
|
|
|
|
|
17 |
|
18 |
-
## Running Model Inference
|
19 |
|
20 |
1. Install packages required for using [Optimum Intel](https://huggingface.co/docs/optimum/intel/index) integration with the OpenVINO backend:
|
21 |
|
@@ -29,7 +30,7 @@ pip install optimum[openvino]
|
|
29 |
from transformers import AutoTokenizer
|
30 |
from optimum.intel.openvino import OVModelForCausalLM
|
31 |
|
32 |
-
model_id = "OpenVINO
|
33 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
34 |
model = OVModelForCausalLM.from_pretrained(model_id)
|
35 |
|
@@ -42,9 +43,40 @@ print(text)
|
|
42 |
|
43 |
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).
|
44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
## Limitations
|
46 |
|
47 |
-
Check the original model card for [limitations]().
|
48 |
|
49 |
## Legal information
|
50 |
|
|
|
12 |
|
13 |
The provided OpenVINO™ IR model is compatible with:
|
14 |
|
15 |
+
* OpenVINO version 2024.2.0 and higher
|
16 |
+
* Optimum Intel 1.18.0 and higher
|
17 |
+
|
18 |
+
## Running Model Inference with [Optimum Intel](https://huggingface.co/docs/optimum/intel/index)
|
19 |
|
|
|
20 |
|
21 |
1. Install packages required for using [Optimum Intel](https://huggingface.co/docs/optimum/intel/index) integration with the OpenVINO backend:
|
22 |
|
|
|
30 |
from transformers import AutoTokenizer
|
31 |
from optimum.intel.openvino import OVModelForCausalLM
|
32 |
|
33 |
+
model_id = "OpenVINO/<model_name>"
|
34 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
35 |
model = OVModelForCausalLM.from_pretrained(model_id)
|
36 |
|
|
|
43 |
|
44 |
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).
|
45 |
|
46 |
+
## Running Model Inference with [OpenVINO GenAI](https://github.com/openvinotoolkit/openvino.genai)
|
47 |
+
|
48 |
+
1. Install packages required for using OpenVINO GenAI.
|
49 |
+
```
|
50 |
+
pip install openvino-genai huggingface_hub
|
51 |
+
```
|
52 |
+
|
53 |
+
2. Download model from HuggingFace Hub
|
54 |
+
|
55 |
+
```
|
56 |
+
import huggingface_hub as hf_hub
|
57 |
+
|
58 |
+
model_id = "OpenVINO/<model_name>"
|
59 |
+
model_path = "<model_name>"
|
60 |
+
|
61 |
+
hf_hub.snapshot_download(model_id, local_dir=model_path)
|
62 |
+
|
63 |
+
```
|
64 |
+
|
65 |
+
3. Run model inference:
|
66 |
+
|
67 |
+
```
|
68 |
+
import openvino_genai as ov_genai
|
69 |
+
|
70 |
+
device = "CPU"
|
71 |
+
pipe = ov_genai.LLMPipeline(model_path, device)
|
72 |
+
print(pipe.generate("What is OpenVINO?"))
|
73 |
+
```
|
74 |
+
|
75 |
+
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)
|
76 |
+
|
77 |
## Limitations
|
78 |
|
79 |
+
Check the original model card for [limitations](https://huggingface.co/EleutherAI/gpt-j-6b#limitations-and-biases).
|
80 |
|
81 |
## Legal information
|
82 |
|