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

feat: load model from path #95

Closed
wants to merge 0 commits into from

Conversation

bassmang
Copy link
Member

No description provided.

@jackgerrits
Copy link
Member

Is there a benefit of this over loading the file in user code?

The reason serialize_to_file was added was the address a performance issue raised in #84. The performance of loading a model was adequate and doesn't suffer the same issues as serialization (continually resizing a vector). To avoid interface bloat I think we should strive to avoid multiple ways of doing things when there isn't clear benefit/reason.

@bassmang
Copy link
Member Author

Is there a benefit of this over loading the file in user code?

The reason serialize_to_file was added was the address a performance issue raised in #84. The performance of loading a model was adequate and doesn't suffer the same issues as serialization (continually resizing a vector). To avoid interface bloat I think we should strive to avoid multiple ways of doing things when there isn't clear benefit/reason.

with open("model.bin", "rb") as f:
     model_data = f.read()
workspace = Workspace(model_data=model_data)

This just seems a bit clunky/unintuitive from a user's perspective for a common operation. Maybe a load_model function to avoid interface bloat?

@bassmang bassmang closed this Jul 21, 2023
@bassmang bassmang deleted the load_model_path branch July 21, 2023 15:59
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.

None yet

2 participants