File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
tests/unitary/default_setup/model_deployment Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -920,11 +920,10 @@ def predict(
920
920
"`data` and `json_input` are both provided. You can only use one of them."
921
921
)
922
922
923
- self ._validate_bandwidth (data or json_input )
924
-
925
923
if auto_serialize_data :
926
924
data = data or json_input
927
925
serialized_data = serializer .serialize (data = data )
926
+ self ._validate_bandwidth (serialized_data )
928
927
return send_request (
929
928
data = serialized_data ,
930
929
endpoint = endpoint ,
@@ -957,6 +956,7 @@ def predict(
957
956
raise ValueError (
958
957
"`model_name` and `model_version` have to be provided together."
959
958
)
959
+ self ._validate_bandwidth (data )
960
960
prediction = send_request (
961
961
data = data ,
962
962
endpoint = endpoint ,
Original file line number Diff line number Diff line change 14
14
ModelDeployment ,
15
15
ModelDeploymentProperties ,
16
16
)
17
+ from ads .model .deployment .model_deployment_infrastructure import ModelDeploymentInfrastructure
18
+ from ads .model .deployment .model_deployment_runtime import ModelDeploymentCondaRuntime
17
19
18
20
19
21
class ModelDeploymentTestCase (unittest .TestCase ):
20
22
MODEL_ID = "<MODEL_OCID>"
21
23
with patch .object (oci_client , "OCIClientFactory" ):
22
24
test_model_deployment = ModelDeployment (
23
- model_deployment_id = "test_model_deployment_id" , properties = {}
25
+ model_deployment_id = "test_model_deployment_id" , properties = {},
26
+ infrastructure = ModelDeploymentInfrastructure (),
27
+ runtime = ModelDeploymentCondaRuntime ()
24
28
)
25
29
26
30
@patch ("requests.post" )
You can’t perform that action at this time.
0 commit comments