Skip to content

Add ability to disable Model Editor API#24402

Closed
skottmckay wants to merge 5 commits intomainfrom
skottmckay/AddSettingToDisableModelEditorApi
Closed

Add ability to disable Model Editor API#24402
skottmckay wants to merge 5 commits intomainfrom
skottmckay/AddSettingToDisableModelEditorApi

Conversation

@skottmckay
Copy link
Contributor

Description

The OrtModel clashes with a type in the winml public API leading to issues as the linker gets confused.
As winml doesn't need any model editing capabilities the cleanest solution is to make it easy to exclude Model Editor API.

Motivation and Context

Resolve type confusion leading to runtime crash in winml

The OrtModel clashes with a type in the winml public API leading to issues as the linker gets confused.
As winml doesn't need any model editing capabilities the cleanest solution is to make it easy to exclude Model Editor API.
return LoadWithLoader(loader, "model_loading_from_saved_proto");
}

common::Status InferenceSession::Load(const OrtModel& model_editor_api_model) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code was moved to make the #ifdef's a bit cleaner. No changes to the code.

@skottmckay
Copy link
Contributor Author

I think this is a better fix and only requires removing the assert on the ORT side:

https://github.com/microsoft/win-onnxruntime/pull/37

@skottmckay
Copy link
Contributor Author

This approach resolves the issue instead of avoiding it so this PR shouldn't be needed. #24474

@skottmckay skottmckay closed this Apr 21, 2025
@skottmckay skottmckay deleted the skottmckay/AddSettingToDisableModelEditorApi branch October 1, 2025 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants