Skip to content
Open
Show file tree
Hide file tree
Changes from 68 commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
43c7e8e
first commit to update modelbuilder
xadupre Apr 10, 2026
bd2366e
lint
xadupre Apr 10, 2026
fb7f0c3
dependency
xadupre Apr 10, 2026
b6a8cc8
fix import issues
xadupre Apr 10, 2026
4306fb1
Potential fix for pull request finding 'CodeQL / Empty except'
xadupre Apr 10, 2026
0518fde
fix
xadupre Apr 10, 2026
d6950e8
fix import issues
xadupre Apr 10, 2026
19d40c2
ls
xadupre Apr 10, 2026
04cfac0
Potential fix for pull request finding 'CodeQL / Signature mismatch i…
xadupre Apr 10, 2026
bf8f708
fix: handle None data_path in conftest, fix CodeQL signature mismatch…
Copilot Apr 10, 2026
52364b4
lint
xadupre Apr 10, 2026
e9b5000
Update test/python/models/fast/test_random_granite.py
xadupre Apr 14, 2026
c0bccd4
Update test/python/models/fast/test_random_gemma.py
xadupre Apr 14, 2026
d41f845
Update test/python/models/fast/test_random_gemma3.py
xadupre Apr 14, 2026
b787806
Update .github/workflows/modelbuilder_fast_tests.yml
xadupre Apr 14, 2026
5d6f67e
Update src/python/py/models/builders/base.py
xadupre Apr 14, 2026
0b169f8
address review: restore formatting, fix gemma3 VLM model_type, remove…
Copilot Apr 14, 2026
ccee173
fix: add comment for FP16 CPU GQA exclusion, rename config var in wor…
Copilot Apr 14, 2026
e069371
Merge branch 'main' of https://github.com/microsoft/onnxruntime-genai…
xadupre Apr 20, 2026
0a5351f
fix style
xadupre Apr 20, 2026
56a4bab
Apply suggestion from @kunal-vaishnavi
xadupre Apr 20, 2026
1962cd8
fix
xadupre Apr 20, 2026
3db7e03
Merge branch 'xadupre/mbext' of https://github.com/microsoft/onnxrunt…
xadupre Apr 20, 2026
0c71fa6
fix gqa
xadupre Apr 20, 2026
960c525
rename ExtTestCase into ModelBuilderTestCase
xadupre Apr 20, 2026
49997a8
fix CodeQL: remove incorrect Model inheritance from Ministral3VisionE…
Copilot Apr 20, 2026
02b1186
remove unnecessary tests
xadupre Apr 20, 2026
40af7a8
rename a file
xadupre Apr 20, 2026
90b0d77
use gqa fir wen35
xadupre Apr 20, 2026
2c5f71f
add og tests
xadupre Apr 20, 2026
263033e
nemotron_h
xadupre Apr 20, 2026
3681b46
Potential fix for pull request finding 'CodeQL / Potentially uninitia…
xadupre Apr 20, 2026
29b111e
remove undesired changes
xadupre Apr 20, 2026
a691f94
fix
xadupre Apr 20, 2026
7cfd93e
fix nemotron model type
xadupre Apr 20, 2026
67df491
style
xadupre Apr 20, 2026
3bb036c
merge
xadupre Apr 21, 2026
7240182
remove transformers 4.57
xadupre Apr 21, 2026
c556000
zero
xadupre Apr 21, 2026
7356997
Update src/python/py/models/builders/mistral.py
xadupre Apr 21, 2026
f5bb55e
add onnxscript
xadupre Apr 21, 2026
63e622b
Merge branch 'xadupre/mbext' of https://github.com/microsoft/onnxrunt…
xadupre Apr 21, 2026
2c91a48
fix
xadupre Apr 21, 2026
5fdef15
fix: use os.path.join for cross-platform paths; remove unreachable co…
Copilot Apr 21, 2026
e918502
fix: cleanup path should use 'output' not 'output_dir' in get_dirs
Copilot Apr 21, 2026
c14803a
big refactoring
xadupre Apr 21, 2026
e6475b3
Merge branch 'xadupre/mbext' of https://github.com/microsoft/onnxrunt…
xadupre Apr 21, 2026
ccc8118
fixes
xadupre Apr 21, 2026
799963d
fix
xadupre Apr 21, 2026
60002b7
refactor: replace PvVersion class with packaging.version.Version
Copilot Apr 21, 2026
2194011
fix
xadupre Apr 21, 2026
7233274
style
xadupre Apr 21, 2026
b251a1e
style
xadupre Apr 21, 2026
f869a6d
fix import
xadupre Apr 21, 2026
a6a6dcb
crash
xadupre Apr 21, 2026
bc1c9ce
fix
xadupre Apr 21, 2026
347b8da
fix
xadupre Apr 21, 2026
b3d133b
donotremove
xadupre Apr 21, 2026
1ac7e60
fix
xadupre Apr 21, 2026
7918593
add missing patch
xadupre Apr 21, 2026
fb4010c
more tests
xadupre Apr 21, 2026
0ec2f77
fix
xadupre Apr 22, 2026
a194ffc
revert
xadupre Apr 22, 2026
423ec5f
better
xadupre Apr 22, 2026
15cc2b2
nemotron
xadupre Apr 22, 2026
076ad4a
remove a decorator
xadupre Apr 22, 2026
913dd2e
add more comments
xadupre Apr 22, 2026
34bf6c3
removing unused imports
xadupre Apr 22, 2026
7fd7752
remove unused imports
xadupre Apr 22, 2026
012ad6d
Potential fix for pull request finding 'CodeQL / Overwriting attribut…
xadupre Apr 23, 2026
4b25fbd
switch to 1.26
xadupre Apr 23, 2026
0ec2843
Merge branch 'xadupre/mbext' of https://github.com/microsoft/onnxrunt…
xadupre Apr 23, 2026
4ea3aaf
use transformers 5.6
xadupre Apr 23, 2026
9d103cb
mistral
xadupre Apr 23, 2026
84c7135
Merge branch 'main' of https://github.com/microsoft/onnxruntime-genai…
xadupre Apr 23, 2026
00117a1
fix name
xadupre Apr 23, 2026
aa6596d
Merge branch 'main' of https://github.com/microsoft/onnxruntime-genai…
xadupre Apr 24, 2026
132f1a1
Merge remote-tracking branch 'origin/main' into xadupre/mbext
Copilot Apr 28, 2026
79e7fdb
remove local_functions.py and use nightly ORT in fast tests workflow
Copilot Apr 28, 2026
d603515
use nightly onnxruntime-genai in fast tests workflow alongside nightl…
Copilot Apr 28, 2026
1a7cd8a
Merge branch 'main' into xadupre/mbext
xadupre Apr 29, 2026
18109bf
fix nemotronh
xadupre Apr 29, 2026
c0f11e6
Initialize q/k/v path
hanbitmyths May 1, 2026
aaa7684
Merge branch 'main' of https://github.com/microsoft/onnxruntime-genai…
xadupre May 4, 2026
76e6c7d
Merge branch 'main' of https://github.com/microsoft/onnxruntime-genai…
xadupre May 5, 2026
e4c3cad
Merge branch 'main' of https://github.com/microsoft/onnxruntime-genai…
xadupre May 6, 2026
273d3fb
Merge branch 'main' - add LFM2 support and resolve builder.py conflict
Copilot May 7, 2026
fae7874
Merge branch 'main' of https://github.com/microsoft/onnxruntime-genai…
xadupre May 12, 2026
8790306
Merge branch 'main' into xadupre/mbext - resolve requirements.txt con…
Copilot May 18, 2026
f977a04
Merge branch 'main' into xadupre/mbext - resolve base.py conflict
Copilot May 20, 2026
daab5e0
remove extra-index-url
xadupre May 20, 2026
2b694c6
Merge branch 'main' into xadupre/mbext - resolve builder.py conflict …
Copilot May 22, 2026
d7b7be8
Merge branch 'main' into xadupre/mbext - resolve conflicts (add Qwen3…
Copilot May 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 135 additions & 0 deletions .github/workflows/modelbuilder_fast_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: Fast Tests

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

permissions:
contents: read

jobs:
tests:
name: ci (${{ matrix.os }}, py${{ matrix.python-version }}, torch-${{ matrix.torch-version || 'stable' }}, transformers-${{ matrix.transformers-version || 'latest' }})
runs-on: ${{ matrix.os }}
permissions:
contents: read
id-token: write
pull-requests: write
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.13"]
transformers-version: ["5.5"]
torch-version: ["2.11"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

# we install torch first to avoid downloading any CUDA dependency

- name: Install nightly pytorch (cpu)
if: matrix.torch-version == 'nightly'
run: pip install --pre --upgrade torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu

Comment thread
xadupre marked this conversation as resolved.
- name: Install pytorch 2.11 (cpu)
if: matrix.torch-version == '2.11' && matrix.os != 'macos-latest'
run: pip install torch==2.11.0+cpu torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu

- name: Install dependencies
run: pip install torch "transformers==${{ matrix.transformers-version }}" tokenizers pandas openpyxl optree onnxruntime onnxruntime-genai peft py-cpuinfo tabulate

- name: Install dependencies
run: pip install -r test/python/requirements.txt
Comment thread
xadupre marked this conversation as resolved.

- name: ls
run: ls . -l

- name: Run fast tests
run: DOCLEAN=1 PYTHONPATH=./src/python/py pytest test/python/models/fast -v --cov=models --cov-report=xml --cov-report=term-missing --test_models=dump_models

# Code to upload coverage report.
# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v5
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# flags: modelbuilder-fast-tests

- name: Upload stats artifact
if: always()
uses: actions/upload-artifact@v4
Comment thread
xadupre marked this conversation as resolved.
with:
name: stats-${{ matrix.os }}-py${{ matrix.python-version }}-torch${{ matrix.torch-version }}-transformers${{ matrix.transformers-version }}
path: stats/
if-no-files-found: ignore

- name: Post test results as PR comment
if: github.event_name == 'pull_request' && always()
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
const path = require('path');

const statsDir = 'stats';
if (!fs.existsSync(statsDir)) {
console.log('No stats directory found, skipping PR comment');
return;
}

const files = fs.readdirSync(statsDir).filter(f => f.endsWith('.csv'));
if (files.length === 0) {
console.log('No CSV result files found in stats/, skipping PR comment');
return;
}

const matrixConfig = 'transformers=${{ matrix.transformers-version }}, torch=${{ matrix.torch-version }}, os=${{ matrix.os }}';
const marker = `<!-- fast-test-results-${{ matrix.transformers-version }}-${{ matrix.torch-version }}-${{ matrix.os }} -->`;
let body = `${marker}\n## Fast Test Results\n\n**Config:** ${matrixConfig}\n\n`;

for (const file of files.sort()) {
const content = fs.readFileSync(path.join(statsDir, file), 'utf8').trim();
const lines = content.split('\n');
if (lines.length < 2) continue;

body += `<details><summary>${file}</summary>\n\n`;

// Convert CSV to markdown table
const rows = lines.map(l => l.split(',').map(c => c.trim()));
const header = rows[0];
body += '| ' + header.join(' | ') + ' |\n';
body += '| ' + header.map(() => '---').join(' | ') + ' |\n';
for (const row of rows.slice(1)) {
body += '| ' + row.join(' | ') + ' |\n';
}
body += '\n</details>\n\n';
}

// Update existing comment for this matrix combination or create a new one
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});

const existing = comments.find(c => c.body && c.body.includes(marker));
if (existing) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existing.id,
body,
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body,
});
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ src/csharp/AssemblyInfo.cs
*.csv
.idea
cache_dir
dump_models
stats
example-models
*.onnx
*.onnx.data
Expand Down
136 changes: 101 additions & 35 deletions src/python/py/models/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,9 @@

import onnx_ir as ir
import torch
from builders import (
ChatGLMModel,
ErnieModel,
Gemma2Model,
Gemma3Model,
GemmaModel,
GPTOSSModel,
GraniteModel,
InternLM2Model,
LlamaModel,
MistralModel,
Model,
NemotronModel,
OLMoModel,
Phi3MiniLongRoPEModel,
Phi3MiniModel,
Phi3MoELongRoPEModel,
Phi3SmallLongRoPEModel,
Phi3SmallModel,
Phi3VModel,
Phi4MMModel,
PhiModel,
Qwen3Model,
Qwen3VLTextModel,
Qwen25VLTextModel,
Qwen35TextModel,
QwenModel,
SmolLM3Model,
WhisperModel,
)
from transformers import (
AutoConfig,
)
from transformers import AutoConfig

from .builders import Model


def check_extra_options(kv_pairs, execution_provider):
Expand Down Expand Up @@ -211,19 +181,30 @@ def create_model(
# Quantized ChatGLM model has ChatGLMForConditionalGeneration as architecture whereas HF model as the latter
config.bos_token_id = 1
config.hidden_act = "swiglu"
from .builders.chatglm import ChatGLMModel

onnx_model = ChatGLMModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
onnx_model.model_type = "chatglm"
elif config.architectures[0] == "Ernie4_5ForCausalLM":
from .builders.ernie import ErnieModel

onnx_model = ErnieModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "GemmaForCausalLM":
from .builders.gemma import GemmaModel

onnx_model = GemmaModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "Gemma2ForCausalLM":
print("WARNING: This model loses accuracy with float16 precision. It is recommended to set `--precision bf16` or `--precision int4 --extra_options use_cuda_bf16=true` by default.")
print(
"WARNING: This model loses accuracy with float16 precision. It is recommended to set `--precision bf16` or `--precision int4 --extra_options use_cuda_bf16=true` by default."
)
from .builders.gemma import Gemma2Model

onnx_model = Gemma2Model(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "Gemma3ForCausalLM":
print("WARNING: This model loses accuracy with float16 precision. It is recommended to set `--precision bf16` or `--precision int4 --extra_options use_cuda_bf16=true` by default.")
from .builders.gemma import Gemma3Model

onnx_model = Gemma3Model(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
onnx_model.model_type = "gemma3_text"
elif config.architectures[0] == "Gemma3ForConditionalGeneration":
text_config = config.text_config
for key in text_config:
Expand All @@ -232,49 +213,122 @@ def create_model(
print("WARNING: This model loses accuracy with float16 precision. It is recommended to set `--precision bf16` or `--precision int4 --extra_options use_cuda_bf16=true` by default.")
print("WARNING: This is only generating the text component of the model. Setting `--extra_options exclude_embeds=true` by default.")
extra_options["exclude_embeds"] = True
from .builders.gemma import Gemma3Model

onnx_model = Gemma3Model(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
onnx_model.model_type = "gemma3"
elif config.architectures[0] == "GptOssForCausalLM":
print("WARNING: This model only supports symmetric quantization for `QMoE`.")
if hasattr(config, "quantization_config") and config.quantization_config.get("quant_method") != "quark":
delattr(config, "quantization_config")
from .builders.gptoss import GPTOSSModel

onnx_model = GPTOSSModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "GraniteForCausalLM":
from .builders.granite import GraniteModel
Comment thread
xadupre marked this conversation as resolved.

onnx_model = GraniteModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "InternLM2ForCausalLM":
from .builders.internlm import InternLM2Model

onnx_model = InternLM2Model(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "LlamaForCausalLM":
from .builders.llama import LlamaModel

onnx_model = LlamaModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "MistralForCausalLM":
from .builders.mistral import MistralModel

onnx_model = MistralModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "Ministral3ForCausalLM":
from .builders.mistral import Ministral3TextModel

if hasattr(config, "quantization_config"):
# Remove FP8 quantization_config to avoid wrong weight loading via
# QuantModel; Ministral3TextModel.load_weights handles dequantization.
delattr(config, "quantization_config")
onnx_model = Ministral3TextModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "Mistral3ForConditionalGeneration":
if hasattr(config, "quantization_config"):
# Remove FP8 quantization_config to avoid wrong weight loading via
# QuantModel; Ministral3TextModel.load_weights handles dequantization.
delattr(config, "quantization_config")
print(
"WARNING: Exporting the text decoder with `exclude_embeds=true` and a separate "
"vision encoder (vision_encoder.onnx) for Mistral3ForConditionalGeneration."
)
from .builders.mistral import Ministral3ConditionalGenerationModel

onnx_model = Ministral3ConditionalGenerationModel(
config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options
)
elif config.architectures[0] == "MistralNeMoForCausalLM":
from .builders.mistral import MistralNeMoModel

onnx_model = MistralNeMoModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "NemotronForCausalLM":
from .builders.nemotron import NemotronModel

onnx_model = NemotronModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "NemotronHForCausalLM":
from .builders.nemotron import NemotronHModel

onnx_model = NemotronHModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "OlmoForCausalLM":
from .builders.olmo import OLMoModel

onnx_model = OLMoModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "Olmo2ForCausalLM":
from .builders.olmo import OLMo2Model

onnx_model = OLMo2Model(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "Olmo3ForCausalLM":
from .builders.olmo import OLMo3Model

onnx_model = OLMo3Model(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "PhiForCausalLM":
from .builders.phi import PhiModel

onnx_model = PhiModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "Phi3ForCausalLM" and config.max_position_embeddings == config.original_max_position_embeddings:
from .builders.phi import Phi3MiniModel

onnx_model = Phi3MiniModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "Phi3ForCausalLM" and config.max_position_embeddings != config.original_max_position_embeddings:
from .builders.phi import Phi3MiniLongRoPEModel

onnx_model = Phi3MiniLongRoPEModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "PhiMoEForCausalLM" and config.max_position_embeddings != config.original_max_position_embeddings:
print("WARNING: This model only works for CUDA currently because `MoE` is only supported for CUDA in ONNX Runtime. Setting `--execution_provider cuda` by default.")
print("WARNING: This model currently only supports the quantized version. Setting `--precision int4` by default.")
from .builders.phi import Phi3MoELongRoPEModel

execution_provider = "cuda"
onnx_dtype = set_onnx_dtype("int4", extra_options)
onnx_model = Phi3MoELongRoPEModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "Phi3SmallForCausalLM" and config.max_position_embeddings == config.original_max_position_embeddings:
from .builders.phi import Phi3SmallModel

onnx_model = Phi3SmallModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "Phi3SmallForCausalLM" and config.max_position_embeddings != config.original_max_position_embeddings:
from .builders.phi import Phi3SmallLongRoPEModel

onnx_model = Phi3SmallLongRoPEModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "Phi3VForCausalLM":
print("WARNING: This is only generating the text component of the model. Setting `--extra_options exclude_embeds=true` by default.")
extra_options["exclude_embeds"] = True
from .builders.phi import Phi3VModel

onnx_model = Phi3VModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "Phi4MMForCausalLM":
print("WARNING: This is only generating the text component of the model. Setting `--extra_options exclude_embeds=true` by default.")
extra_options["exclude_embeds"] = True
from .builders.phi import Phi4MMModel

onnx_model = Phi4MMModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "Qwen2ForCausalLM":
from .builders.qwen import QwenModel

onnx_model = QwenModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "Qwen2_5_VLForConditionalGeneration":
text_config = config.text_config
Expand All @@ -283,10 +337,16 @@ def create_model(
setattr(config, key, getattr(text_config, key))
print("WARNING: This is only generating the text component of the model. Setting `--extra_options exclude_embeds=true` by default.")
extra_options["exclude_embeds"] = True
from .builders.qwen import Qwen25VLTextModel

onnx_model = Qwen25VLTextModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "Qwen3ForCausalLM":
from .builders.qwen import Qwen3Model

onnx_model = Qwen3Model(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "Qwen3_5ForConditionalGeneration":
from .builders.qwen import Qwen35TextModel

onnx_model = Qwen35TextModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "Qwen3VLForConditionalGeneration":
text_config = config.text_config
Expand All @@ -295,10 +355,16 @@ def create_model(
setattr(config, key, getattr(text_config, key))
print("WARNING: This is only generating the text component of the model. Setting `--extra_options exclude_embeds=true` by default.")
extra_options["exclude_embeds"] = True
from .builders.qwen import Qwen3VLTextModel

onnx_model = Qwen3VLTextModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "SmolLM3ForCausalLM":
from .builders.smollm import SmolLM3Model

onnx_model = SmolLM3Model(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config.architectures[0] == "WhisperForConditionalGeneration":
from .builders.whisper import WhisperModel

onnx_model = WhisperModel(config, io_dtype, onnx_dtype, execution_provider, cache_dir, extra_options)
elif config_only:
# Create base Model class to guess model attributes
Expand Down
Loading
Loading