split upload_model to save & upload
#99
Merged
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.
Before submitting
What does this PR do?
This pull request refactors the model I/O interface by splitting the
upload_modelfunctionality into two distinct methods:save_modelandupload_model. The goal is to improve clarity, separate concerns, and provide better parity with the existingdownload_model/load_modelinterface.Changes Introduced
save_model(obj)Handles the serialization and saving of a model object to a local file or directory. This is the "magic" part that dumps an in-memory object to disk.
upload_model(path)Uploads a model from a given path (file or directory) to the remote storage. This is now a simple and explicit method that assumes the model has already been saved locally.
Motivation
Previously,
upload_modeldid both:This implicit behavior made the API less predictable and harder to pair cleanly with its counterparts (
download_modelvsload_model). With this change:save_model↔load_modelhandle local serialization/deserializationupload_model↔download_modelhandle remote transfersThis separation of concerns improves readability, control, and consistency across the model management workflow.
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in GitHub issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃