commit files to HF hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
tags:
|
| 5 |
+
- openvino
|
| 6 |
+
---
|
| 7 |
+
|
| 8 |
+
# microsoft/phi-2
|
| 9 |
+
|
| 10 |
+
This is the [microsoft/phi-2](https://huggingface.co/microsoft/phi-2) model converted to [OpenVINO](https://openvino.ai) with INT8 weights compression for accelerated inference.
|
| 11 |
+
|
| 12 |
+
An example of how to do inference on this model:
|
| 13 |
+
```python
|
| 14 |
+
from optimum.intel import OVModelForCausalLM
|
| 15 |
+
from transformers import AutoTokenizer, pipeline
|
| 16 |
+
|
| 17 |
+
# model_id should be set to either a local directory or a model available on the HuggingFace hub.
|
| 18 |
+
model_id = "helenai/microsoft-phi-2-ov"
|
| 19 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 20 |
+
model = OVModelForCausalLM.from_pretrained(model_id)
|
| 21 |
+
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
| 22 |
+
result = pipe("hello world")
|
| 23 |
+
print(result)
|
| 24 |
+
```
|
| 25 |
+
|