microsoft / microsoft/onnxruntime-genai

Language Model (excluding embedding layer) cannot take inputs_embeds

Open
#1,644 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
1.1k
Forks
354
Avg merge
2d 16h
Merged PRs (30d)
85

Description

I have a Pixtral multimodal model that uses a Mistral language decoder. I want to utilize the optimized ONNX Mistral language decoder instead of the native PyTorch implementation. In the forward process, I receive the input embeddings that capture both the text and image information. I want to take this embedding now and feed it into the ONNX model and perform inference with onnxruntime_genai. However, when I create the model parameters with params = og.GeneratorParams(model), it still creates input_ids which my decoder-only model does not have, leaving me with the following error: RuntimeError: Model input was not found: input_ids. Has there been a solution to this issue or a workaround such that my ONNX Mistral model can take in embeddings directly as an input? Otherwise, if I work with just input_ids, I cannot incorporate the image embeddings into the input.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the onnxruntime_genai path around og.GeneratorParams(model) and the model inputs that produce the input_ids error. Check how ONNX Mistral decoder inputs are defined and whether input embeddings are exposed during onnxruntime_genai inference; done means the decoder accepts text-and-image embeddings without requiring input_ids, or the supported workaround is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
ai, machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.