1919import torch
2020
2121from optimum .utils .import_utils import (
22- is_ipex_available ,
2322 is_onnxruntime_available ,
2423 is_openvino_available ,
2524 is_optimum_intel_available ,
@@ -190,8 +189,8 @@ def pipeline(
190189 Can be used to force using a custom pipeline class. If not provided, the default pipeline class for the
191190 specified task will be used.
192191 accelerator (`str`, *optional*):
193- The accelerator to use, either `"ort"` for ONNX Runtime, `"ov"` for OpenVINO, or `"ipex "` for Intel
194- Extension for PyTorch. If no accelerator is specified, will default to the one currently installed/available.
192+ The accelerator to use, either `"ort"` for ONNX Runtime or `"ov "` for OpenVINO.
193+ If no accelerator is specified, will default to the one currently installed/available.
195194 kwargs (`dict[str, Any]`, *optional*):
196195 Additional keyword arguments passed along to the specific pipeline init (see the documentation for the
197196 corresponding pipeline class for possible values).
@@ -202,9 +201,9 @@ def pipeline(
202201 >>> from optimum.pipelines import pipeline
203202 >>> # Sentiment analysis pipeline with default model, using OpenVINO
204203 >>> analyzer = pipeline("sentiment-analysis", accelerator="ov")
205- >>> # Question answering pipeline, specifying the checkpoint identifier, with IPEX
204+ >>> # Question answering pipeline, specifying the checkpoint identifier, with OpenVINO
206205 >>> oracle = pipeline(
207- ... "question-answering", model="distilbert/distilbert-base-cased-distilled-squad", tokenizer="google-bert/bert-base-cased", accelerator="ipex "
206+ ... "question-answering", model="distilbert/distilbert-base-cased-distilled-squad", tokenizer="google-bert/bert-base-cased", accelerator="ov "
208207 ... )
209208 >>> # Named entity recognition pipeline, passing in a specific model and tokenizer, with ONNX Runtime
210209 >>> model = ORTModelForTokenClassification.from_pretrained("dbmdz/bert-large-cased-finetuned-conll03-english")
@@ -225,18 +224,11 @@ def pipeline(
225224 "`accelerator` not specified. Using ONNX Runtime (`ort`) as the accelerator since `optimum-onnx[onnxruntime]` is installed."
226225 )
227226 accelerator = "ort"
228- elif is_optimum_intel_available () and is_ipex_available ():
229- logger .info (
230- "`accelerator` not specified. Using IPEX (`ipex`) as the accelerator since `optimum-intel[ipex]` is installed."
231- )
232- accelerator = "ipex"
233227 else :
234228 raise ImportError (
235229 "You need to install either `optimum-onnx[onnxruntime]` to use ONNX Runtime as an accelerator, "
236- "or `optimum-intel[openvino]` to use OpenVINO as an accelerator, "
237- "or `optimum-intel[ipex]` to use IPEX as an accelerator."
230+ "or `optimum-intel[openvino]` to use OpenVINO as an accelerator."
238231 )
239-
240232 if accelerator == "ort" :
241233 from optimum .onnxruntime import pipeline as ort_pipeline # type: ignore
242234
@@ -260,7 +252,7 @@ def pipeline(
260252 pipeline_class = pipeline_class ,
261253 ** kwargs ,
262254 )
263- elif accelerator in [ "ov" , "ipex" ] :
255+ elif accelerator == "ov" :
264256 from optimum .intel import pipeline as intel_pipeline # type: ignore
265257
266258 return intel_pipeline (
@@ -284,5 +276,9 @@ def pipeline(
284276 accelerator = accelerator ,
285277 ** kwargs ,
286278 )
279+ elif accelerator == "ipex" :
280+ raise ValueError (
281+ "The `ipex` accelerator is deprecated and no longer supported. Please use `ov` (OpenVINO) instead."
282+ )
287283 else :
288- raise ValueError (f"Accelerator { accelerator } not recognized. Please use 'ort', 'ov' or 'ipex '." )
284+ raise ValueError (f"Accelerator { accelerator } not recognized. Please use 'ort' or 'ov '." )
0 commit comments