commit files to HF hub
Browse files
README.md
CHANGED
@@ -9,16 +9,17 @@ tags:
|
|
9 |
|
10 |
This is the [csarron/bert-base-uncased-squad-v1](https://huggingface.co/csarron/bert-base-uncased-squad-v1) model converted to [OpenVINO](https://openvino.ai), for accellerated inference.
|
11 |
|
12 |
-
An example of how to do inference
|
13 |
-
|
14 |
```python
|
15 |
-
from optimum.intel.openvino import
|
16 |
from transformers import AutoTokenizer, pipeline
|
17 |
|
18 |
-
model_id
|
|
|
19 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
20 |
-
model =
|
21 |
-
pipe = pipeline("
|
22 |
-
result = pipe(
|
23 |
print(result)
|
24 |
```
|
|
|
|
9 |
|
10 |
This is the [csarron/bert-base-uncased-squad-v1](https://huggingface.co/csarron/bert-base-uncased-squad-v1) model converted to [OpenVINO](https://openvino.ai), for accellerated inference.
|
11 |
|
12 |
+
An example of how to do inference on this model:
|
|
|
13 |
```python
|
14 |
+
from optimum.intel.openvino import $model_class_str
|
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 = "$new_model_id"
|
19 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
20 |
+
model = $model_class_str.from_pretrained(model_id)
|
21 |
+
pipe = pipeline("$task", model=model, tokenizer=tokenizer)
|
22 |
+
result = pipe($input_text)
|
23 |
print(result)
|
24 |
```
|
25 |
+
|