huggingface / optimum-intel

🤗 Optimum Intel: Accelerate inference with Intel optimization tools
https://huggingface.co/docs/optimum/main/en/intel/index
Apache License 2.0
358 stars 99 forks source link

Add OpenVINO pipelines #740

Closed echarlaix closed 3 weeks ago

echarlaix commented 1 month ago

Add pipelines able to load a model and convert it to the openvino format if needed

from optimum.intel.pipelines import pipeline

# Load openvino model
ov_pipe = pipeline("text-generation", "helenai/gpt2-ov", accelerator="openvino")
# Load pytorch model and convert it to openvino before inference
pipe = pipeline("text-generation", "gpt2", accelerator="openvino")

@helena-intel @eaidova

HuggingFaceDocBuilderDev commented 1 month ago

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.