Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow loading models from memory #36

Merged
merged 2 commits into from
Nov 1, 2020
Merged

Allow loading models from memory #36

merged 2 commits into from
Nov 1, 2020

Conversation

krazijames
Copy link
Contributor

@krazijames krazijames commented Oct 30, 2020

ONNX Runtime has a function which allows loading models from memory, but I could not find API for this in onnxruntime crate. So I added with_model_from_memory() to SessionBuilder based on with_model_from_file() and I tested it with byte array created via include_bytes!() and it works!
I thought it would be nice to share with you. Hope you like it.

@nbigaouette
Copy link
Owner

Thanks for this!

I wonder if a test could be added for this?

Right now, there isn't an onnx model committed to the repo so one would have to be downloaded first...

I guess I could add mnist-8.onnx to the repo (it's ~25 KB) so it could be used in tests...

Let's merge this first ;)

@nbigaouette nbigaouette merged commit 32e9935 into nbigaouette:master Nov 1, 2020
@krazijames krazijames deleted the load-model-from-memory branch November 2, 2020 00:15
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