fix: handle generic ort::Error type in ort 2.0.0-rc.12 - #51
Open
yanxue06 wants to merge 2 commits into
Open
Conversation
The ort crate changed Error from a plain struct to Error<R = ()> in rc.12. Session builder methods now return Error<SessionBuilder> which doesn't auto-convert via #[from]. Map through ort::Error::from to convert to Error<()> before the ? operator. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the embedding model initialization code to compile against ort v2.0.0-rc.12, which changed ort::Error to be generic (Error<R = ()>), and refreshes the lockfile accordingly.
Changes:
- Convert
SessionBuilder-typedort::Error<R>values intoort::Error<()>viaort::Error::fromso existing#[from] ort::Errorconversions continue to work with?. - Update
Cargo.lockto resolveort/ort-systo2.0.0-rc.12and reflect transitive dependency changes.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/embedding/model.rs |
Adds explicit error mapping steps in the ONNX session builder chain to accommodate ort::Error<R> in rc.12. |
Cargo.lock |
Updates resolved crate versions/transitives for the ort rc.12 upgrade. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ortv2.0.0-rc.12 changingErrorfrom a plain struct toError<R = ()>Error<SessionBuilder>which doesn't auto-convert via#[from] ort::Errorort::Error::fromto convertError<SessionBuilder>→Error<()>before the?operatorTest plan
cargo checkpassescargo test)🤖 Generated with Claude Code