Skip to content

Commit 5c6fa49

Browse files
author
Ziqun Ye
committed
adding raise e
1 parent a45bc10 commit 5c6fa49

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ads/opctl/backend/local.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,6 @@ def predict(self) -> None:
650650
model_folder = os.path.expanduser(self.config["execution"].get("model_save_folder", DEFAULT_MODEL_FOLDER))
651651
artifact_directory = artifact_directory or os.path.join(model_folder, str(ocid))
652652
if ocid and (not os.path.exists(artifact_directory) or len(os.listdir(artifact_directory)) == 0):
653-
654653
region = self.config["execution"].get("region", None)
655654
bucket_uri = self.config["execution"].get("bucket_uri", None)
656655
timeout = self.config["execution"].get("timeout", None)
@@ -718,8 +717,10 @@ def _download_model(self, ocid, artifact_directory, region, bucket_uri, timeout)
718717
timeout=timeout,
719718
bucket_uri=bucket_uri,
720719
)
721-
except:
720+
721+
except Exception as e :
722722
shutil.rmtree(artifact_directory, ignore_errors=True)
723+
raise e
723724

724725
def _get_conda_info_from_catalog(self, ocid):
725726
response = self.client.get_model(ocid)

ads/opctl/conda/cmds.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,8 @@ def _install(
310310
None
311311
"""
312312
ns, bucket, path, slug = parse_conda_uri(conda_uri)
313+
if bucket == "service-conda-packs":
314+
raise ValueError("Download service conda pack is not allowed. Only custom conda pack can be downloaded to local machine. You need to publish it to your own bucket first.")
313315
os.makedirs(conda_pack_folder, exist_ok=True)
314316
pack_path = os.path.join(os.path.expanduser(conda_pack_folder), slug + ".tar.gz")
315317
pack_folder_path = os.path.join(os.path.expanduser(conda_pack_folder), slug)

0 commit comments

Comments
 (0)