ONNX Model Zoo

Maximum2000/Phi-4-multimodal-instruct-onnx

By Maximum2000 · ↓ 0 · ♥ 1 · Updated 2025-03-06

What's in this repo

This page lists the files in Maximum2000/Phi-4-multimodal-instruct-onnx, including phi-4-mm-embedding.onnx, phi-4-mm-speech.onnx, phi-4-mm-text.onnx and more.

  • 4 ONNX models (.onnx files)
  • 21 files, including 8 .json, 4 .onnx, 4 .data, 2 .onnx_adapter, 1 .md, 1 .txt
  • Last updated 2025-03-06

ONNX files

File Size Download
phi-4-mm-embedding.onnx — Download
phi-4-mm-speech.onnx — Download
phi-4-mm-text.onnx — Download
phi-4-mm-vision.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

Phi-4 Multimodal Instruct ONNX models

This is non quantized version of the Phi-4 Multimodal Instruct ONNX model

Introduction

This is an ONNX version of the Phi-4 multimodal model that is quantized to int4 precision to accelerate inference with ONNX Runtime.

Model Run

For CPU: stay tuned or follow this tutorial to generate your own ONNX models for CPU!

<!-- ```bash

Download the model directly using the Hugging Face CLI

huggingface-cli download microsoft/Phi-4-multimodal-instruct-onnx --include cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/* --local-dir .

Install the CPU package of ONNX Runtime GenAI

pip install --pre onnxruntime-genai

Please adjust the model directory (-m) accordingly

curl https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/phi4-mm.py -o phi4-mm.py python phi4-mm.py -m cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4 -e cpu


For CUDA:

```bash
# Download the model directly using the Hugging Face CLI
huggingface-cli download microsoft/Phi-4-multimodal-instruct-onnx --include gpu/* --local-dir .

# Install the CUDA package of ONNX Runtime GenAI
pip install --pre onnxruntime-genai-cuda

# Please adjust the model directory (-m) accordingly 
curl https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/phi4-mm.py -o phi4-mm.py
python phi4-mm.py -m gpu/gpu-int4-rtn-block-32 -e cuda

For DirectML:

# Download the model directly using the Hugging Face CLI
huggingface-cli download microsoft/Phi-4-multimodal-instruct-onnx --include gpu/* --local-dir .

# Install the DML package of ONNX Runtime GenAI
pip install --pre onnxruntime-genai-directml

# Please adjust the model directory (-m) accordingly 
curl https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/phi4-mm.py -o phi4-mm.py
python phi4-mm.py -m gpu/gpu-int4-rtn-block-32 -e dml

You will be prompted to provide any images, audios, and a prompt.

The performance of the text component is similar to the Phi-4 mini ONNX models

Model Description

  • Developed by: Microsoft
  • Model type: ONNX
  • License: MIT
  • Model Description: This is a conversion of Phi4 multimodal model for ONNX Runtime inference.

Disclaimer: Model is only an optimization of the base model, any risk associated with the model is the responsibility of the user of the model. Please verify and test for you scenarios. There may be a slight difference in output from the base model with the optimizations applied.

Base Model

Phi-4-multimodal-instruct is a lightweight open multimodal foundation model that leverages the language, vision, and speech research and datasets used for Phi-3.5 and 4.0 models. The model processes text, image, and audio inputs, generating text outputs, and comes with 128K token context length. The model underwent an enhancement process, incorporating both supervised fine-tuning, and direct preference optimization to support precise instruction adherence and safety measures.

See details here

Model info

onnx nlp code audio automatic-speech-recognition speech-summarization speech-translation visual-question-answering phi-4-multimodal phi phi-4-mini multilingual
↓ 0 ♥ 1

Created: 2025-03-06

Updated: 2025-03-06

View on Hugging Face

Files (21)

.gitattributes
README.md
added_tokens.json
genai_config.json
merges.txt
phi-4-mm-embedding.onnx ONNX
phi-4-mm-embedding.onnx.data
phi-4-mm-speech.onnx ONNX
phi-4-mm-speech.onnx.data
phi-4-mm-speech.onnx_adapter
phi-4-mm-text.onnx ONNX
phi-4-mm-text.onnx.data
phi-4-mm-vision.onnx ONNX
phi-4-mm-vision.onnx.data
phi-4-mm-vision.onnx_adapter
special_tokens_map.json
speech_processor.json
tokenizer.json
tokenizer_config.json
vision_processor.json
vocab.json

Related models