{"library":"optimum-intel","title":"Optimum Intel","description":"Optimum Intel extends the Hugging Face Transformers and Diffusers libraries, providing a framework to integrate Intel's specialized tools and libraries like OpenVINO, Neural Compressor, and Intel Extension for PyTorch. It enables optimization, conversion (e.g., to OpenVINO IR format), and accelerated inference of deep learning models on Intel architectures. The library is actively maintained with frequent minor version releases, currently at 1.27.0.","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":["pip install --upgrade-strategy eager \"optimum-intel[openvino]\"","pip install optimum-intel"],"cli":{"name":"optimum-cli","version":""}},"imports":["from optimum.intel import OVModelForCausalLM","from optimum.intel import OVModelForSeq2SeqLM","from optimum.intel import OVStableDiffusionPipeline","from optimum.intel import INCModelForSequenceClassification"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from transformers import AutoTokenizer, pipeline\nfrom optimum.intel import OVModelForSequenceClassification\n\nmodel_id = \"distilbert-base-uncased-finetuned-sst-2-english\"\ntokenizer = AutoTokenizer.from_pretrained(model_id)\n# Load and convert the model to OpenVINO IR format on the fly\nmodel = OVModelForSequenceClassification.from_pretrained(model_id, export=True)\n\n# Run inference\nclassifier = pipeline(\"text-classification\", model=model, tokenizer=tokenizer)\nresults = classifier(\"Optimum Intel is great!\")\nprint(results)","lang":"python","description":"This quickstart demonstrates loading a pre-trained sentiment analysis model, converting it to OpenVINO Intermediate Representation (IR) format on the fly using `export=True`, and running inference with a Hugging Face pipeline. Ensure `optimum-intel[openvino]` and `transformers` are installed.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}