From 5ef2be8a286d1bab6b8df9b62b454418a9d1eb4d Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Tue, 9 Apr 2024 14:56:25 +0800 Subject: [PATCH] fix(cli): correct the comparison of upload status Signed-off-by: Frost Ming --- src/bentoml/_internal/cloud/bentocloud.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bentoml/_internal/cloud/bentocloud.py b/src/bentoml/_internal/cloud/bentocloud.py index f2a8cdb110a..d3a6530d9f2 100644 --- a/src/bentoml/_internal/cloud/bentocloud.py +++ b/src/bentoml/_internal/cloud/bentocloud.py @@ -134,7 +134,7 @@ def push_model(model: Model) -> None: if ( not force and remote_bento - and remote_bento.upload_status == BentoUploadStatus.SUCCESS + and remote_bento.upload_status == BentoUploadStatus.SUCCESS.value ): self.spinner.log_progress.add_task( f'[bold blue]Push skipped: Bento "{bento.tag}" already exists in remote Bento store' @@ -394,7 +394,7 @@ def chunk_upload( status=BentoUploadStatus.FAILED, reason=str(e), ) - if finish_req.status is BentoUploadStatus.FAILED: + if finish_req.status == BentoUploadStatus.FAILED.value: self.spinner.log_progress.add_task( f'[bold red]Failed to upload Bento "{bento.tag}"' ) @@ -406,7 +406,7 @@ def chunk_upload( version=version, req=finish_req, ) - if finish_req.status != BentoUploadStatus.SUCCESS: + if finish_req.status != BentoUploadStatus.SUCCESS.value: self.spinner.log_progress.add_task( f'[bold red]Failed pushing Bento "{bento.tag}": {finish_req.reason}' ) @@ -633,7 +633,7 @@ def _do_push_model( if ( not force and remote_model - and remote_model.upload_status == ModelUploadStatus.SUCCESS + and remote_model.upload_status == ModelUploadStatus.SUCCESS.value ): self.spinner.log_progress.add_task( f'[bold blue]Model "{model.tag}" already exists in remote model store, skipping' @@ -851,7 +851,7 @@ def chunk_upload( status=ModelUploadStatus.FAILED, reason=str(e), ) - if finish_req.status is ModelUploadStatus.FAILED: + if finish_req.status == ModelUploadStatus.FAILED.value: self.spinner.log_progress.add_task( f'[bold red]Failed to upload model "{model.tag}"' ) @@ -864,7 +864,7 @@ def chunk_upload( req=finish_req, ) - if finish_req.status != ModelUploadStatus.SUCCESS: + if finish_req.status != ModelUploadStatus.SUCCESS.value: self.spinner.log_progress.add_task( f'[bold red]Failed pushing model "{model.tag}" : {finish_req.reason}' )