Skip to content

Commit e8fb76d

Browse files
clean up
1 parent c7c1aa3 commit e8fb76d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ads/model/generic_model.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3024,9 +3024,15 @@ def download_artifact(
30243024
The connection timeout in seconds for the client.
30253025
"""
30263026

3027+
model_id = ocid.lower()
3028+
target_dir = (
3029+
artifact_dir
3030+
if not ObjectStorageDetails.is_oci_path(artifact_dir)
3031+
else tempfile.mkdtemp()
3032+
)
3033+
30273034
model_deployment = None
30283035

3029-
model_id = ocid.lower()
30303036
if DataScienceModelType.MODEL_DEPLOYMENT in ocid:
30313037
model_deployment = ModelDeployment.from_id(ocid)
30323038
model_id = model_deployment.properties.model_id
@@ -3035,12 +3041,6 @@ def download_artifact(
30353041
f"Invalid OCID: {ocid}. Please provide valid model OCID or model deployment OCID."
30363042
)
30373043

3038-
target_dir = (
3039-
artifact_dir
3040-
if not ObjectStorageDetails.is_oci_path(artifact_dir)
3041-
else tempfile.mkdtemp()
3042-
)
3043-
30443044
dsc_model = DataScienceModel.from_id(model_id)
30453045

30463046
if not load_artifact:

0 commit comments

Comments
 (0)