Skip to content

Commit b1d2223

Browse files
added a bert with pooler
1 parent 17d4285 commit b1d2223

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

optimum/intel/openvino/modeling.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ def forward(
957957

958958

959959
CUSTOM_TASKS_EXAMPLE = """
960-
Example of custom tasks (e.g. a sentence transformers taking `pooler_output` as output):
960+
Example of custom tasks (e.g. a sentence transformers with a pooler head):
961961
962962
```python
963963
>>> from transformers import {processor_class}
@@ -977,20 +977,16 @@ def forward(
977977

978978
@add_start_docstrings(
979979
"""
980-
OpenVINO Model for custom tasks.
980+
OpenVINO Model for custom tasks. It can be used to leverage the inference acceleration for any single-file OpenVINO model, that may use custom inputs and outputs.
981981
""",
982982
MODEL_START_DOCSTRING,
983983
)
984984
class OVModelForCustomTasks(OVModel):
985-
"""
986-
OpenVINO Model for any custom tasks. It can be used to leverage the inference acceleration for any single-file ONNX model, that may use custom inputs and outputs.
987-
"""
988-
989985
@add_start_docstrings_to_model_forward(
990986
CUSTOM_TASKS_EXAMPLE.format(
991987
processor_class=_TOKENIZER_FOR_DOC,
992988
model_class="OVModelForCustomTasks",
993-
checkpoint="sentence-transformers/all-MiniLM-L6-v2",
989+
checkpoint="IlyasMoutawwakil/bert-with-pooler",
994990
)
995991
)
996992
def forward(self, **kwargs):
@@ -1001,7 +997,7 @@ def forward(self, **kwargs):
1001997
raise ValueError(
1002998
f"Got unexpected inputs: expecting the following inputs : {', '.join(expected_inputs_names)} but got : {', '.join(inputs_names)}."
1003999
)
1004-
1000+
10051001
np_inputs = isinstance(next(iter(kwargs.values())), np.ndarray)
10061002
inputs = {}
10071003
for input_name in self.input_names:

0 commit comments

Comments
 (0)