Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Made it easier to request the latest framework version when ca…
…lling Model.upload_* Goal: make it easier for the calling functions to ask for the latest framework version. It turns out that the current approach complicates calling the upload_* functions, because there is no values of the *_version parameter that mean "latest version". This leads to the need to have different code paths depending on whether the user has given an explicit version value. Example of the problem: ```python def my_import_xgboost_model( model_path: str, xgboost_version: Optional[str] = None, ): if xgboost_version: aiplatfor.Model.upload_xgboost_model(model_path=model_path, xgboost_version=xgboost_version) else: aiplatfor.Model.upload_xgboost_model(model_path=model_path) ``` With this small change, the call is simplified: ```python def my_import_xgboost_model( model_path: str, xgboost_version: Optional[str] = None, ): aiplatfor.Model.upload_xgboost_model(model_path=model_path, xgboost_version=xgboost_version) ``` P.S. It would be great if the `get_prebuilt_prediction_container_uri` function supported the "latest version" feature.
- Loading branch information