Skip to content

Conversation

@Borda
Copy link
Contributor

@Borda Borda commented Apr 17, 2025

Before submitting
  • Was this discussed/agreed via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

What does this PR do?

This pull request refactors the model I/O interface by splitting the upload_model functionality into two distinct methods: save_model and upload_model. The goal is to improve clarity, separate concerns, and provide better parity with the existing download_model / load_model interface.

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_model did both:

  1. Serializing the model to disk
  2. Uploading it to remote storage

This implicit behavior made the API less predictable and harder to pair cleanly with its counterparts (download_model vs load_model). With this change:

  • save_modelload_model handle local serialization/deserialization
  • upload_modeldownload_model handle remote transfers

This 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 🙃

@codecov
Copy link

codecov bot commented Apr 17, 2025

Codecov Report

Attention: Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 89%. Comparing base (0eecc43) to head (321f3bd).
Report is 1 commits behind head on main.

Additional details and impacted files
@@        Coverage Diff         @@
##           main   #99   +/-   ##
==================================
- Coverage    89%   89%   -0%     
==================================
  Files        12    12           
  Lines       482   489    +7     
==================================
+ Hits        431   436    +5     
- Misses       51    53    +2     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Borda Borda merged commit 4c381c6 into main Apr 17, 2025
41 checks passed
@Borda Borda deleted the add/save-model branch April 17, 2025 17:10
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