Skip to content

Commit 5fe97d4

Browse files
committed
Updated pr.
1 parent 000210a commit 5fe97d4

File tree

2 files changed

+2
-19
lines changed

2 files changed

+2
-19
lines changed

ads/model/deployment/model_deployment.py

-8
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
MODEL_DEPLOYMENT_INSTANCE_COUNT = 1
7171
MODEL_DEPLOYMENT_BANDWIDTH_MBPS = 10
7272

73-
MAX_ARTIFACT_SIZE_IN_BYTES = 2147483648 # 2GB
7473

7574
class ModelDeploymentLogType:
7675
PREDICT = "predict"
@@ -1567,13 +1566,6 @@ def _build_model_deployment_configuration_details(self) -> Dict:
15671566

15681567
model_id = runtime.model_uri
15691568
if not model_id.startswith("ocid"):
1570-
if ads_utils.folder_size(runtime.model_uri) > MAX_ARTIFACT_SIZE_IN_BYTES:
1571-
if not runtime.bucket_uri:
1572-
raise ValueError(
1573-
f"The model artifacts size is greater than `{MAX_ARTIFACT_SIZE_IN_BYTES}`. "
1574-
"The `bucket_uri` needs to be specified to copy artifacts to the object storage bucket. "
1575-
"Example: `runtime.with_bucket_uri(oci://<bucket_name>@<namespace>/prefix/)`"
1576-
)
15771569

15781570
from ads.model.datascience_model import DataScienceModel
15791571

tests/unitary/default_setup/model_deployment/test_model_deployment_v2.py

+2-11
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import unittest
1212
import pandas
1313
from unittest.mock import MagicMock, patch
14-
from ads.common import utils
1514
from ads.common.oci_datascience import OCIDataScienceMixin
1615
from ads.common.oci_logging import ConsolidatedLog, OCILog
1716
from ads.common.oci_mixin import OCIModelMixin
@@ -23,7 +22,6 @@
2322
ModelDeployment,
2423
ModelDeploymentLogType,
2524
ModelDeploymentFailedError,
26-
MAX_ARTIFACT_SIZE_IN_BYTES,
2725
)
2826
from ads.model.deployment.model_deployment_infrastructure import (
2927
ModelDeploymentInfrastructure,
@@ -1390,10 +1388,8 @@ def test_model_deployment_with_subnet_id(self):
13901388
"create_model_deployment",
13911389
)
13921390
@patch.object(DataScienceModel, "create")
1393-
@patch.object(utils, "folder_size")
13941391
def test_model_deployment_with_large_size_artifact(
13951392
self,
1396-
mock_folder_size,
13971393
mock_create,
13981394
mock_create_model_deployment,
13991395
mock_sync
@@ -1409,6 +1405,7 @@ def test_model_deployment_with_large_size_artifact(
14091405
.with_overwrite_existing_artifact(True)
14101406
.with_remove_existing_artifact(True)
14111407
.with_timeout(100)
1408+
.with_bucket_uri("test_bucket_uri")
14121409
)
14131410

14141411
runtime_dict = model_deployment.runtime.to_dict()["spec"]
@@ -1417,20 +1414,14 @@ def test_model_deployment_with_large_size_artifact(
14171414
assert runtime_dict["overwriteExistingArtifact"] == True
14181415
assert runtime_dict["removeExistingArtifact"] == True
14191416
assert runtime_dict["timeout"] == 100
1417+
assert runtime_dict["bucketUri"] == "test_bucket_uri"
14201418

14211419
response = MagicMock()
14221420
response.data = OCI_MODEL_DEPLOYMENT_RESPONSE
14231421
mock_create_model_deployment.return_value = response
14241422
model_deployment = self.initialize_model_deployment()
14251423
model_deployment.set_spec(model_deployment.CONST_ID, "test_model_deployment_id")
14261424

1427-
mock_folder_size.return_value = MAX_ARTIFACT_SIZE_IN_BYTES + 1
1428-
with pytest.raises(ValueError):
1429-
model_deployment.deploy(wait_for_completion=False)
1430-
1431-
model_deployment.runtime.with_bucket_uri("test_bucket_uri")
1432-
runtime_dict = model_deployment.runtime.to_dict()["spec"]
1433-
assert runtime_dict["bucketUri"] == "test_bucket_uri"
14341425
create_model_deployment_details = (
14351426
model_deployment._build_model_deployment_details()
14361427
)

0 commit comments

Comments
 (0)