helenai commited on
Commit
f69b218
1 Parent(s): 5a308ae

commit files to HF hub

Browse files
Files changed (1) hide show
  1. README.md +8 -7
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 with this model:
13
-
14
  ```python
15
- from optimum.intel.openvino import OVModelForQuestionAnswering
16
  from transformers import AutoTokenizer, pipeline
17
 
18
- model_id = "csarron/bert-base-uncased-squad-v1"
 
19
  tokenizer = AutoTokenizer.from_pretrained(model_id)
20
- model = OVModelForQuestionAnswering.from_pretrained(new_model_id)
21
- pipe = pipeline("question-answering", model=model, tokenizer=tokenizer)
22
- result = pipe(*"What is OpenVINO?", "OpenVINO is a framework that accelerates deep learning inferencing")
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
+