@@ -439,6 +439,9 @@ def set_deployment_config(self, config_name: Optional[str]) -> None:
439
439
The name of the deployment config. Set to None to unset
440
440
any existing config that is applied to the model.
441
441
"""
442
+ if self .pysdk_model is None :
443
+ self .pysdk_model = self ._create_pre_trained_js_model ()
444
+
442
445
self .pysdk_model .set_deployment_config (config_name )
443
446
444
447
def get_deployment_config (self ) -> Optional [Dict [str , Any ]]:
@@ -447,10 +450,16 @@ def get_deployment_config(self) -> Optional[Dict[str, Any]]:
447
450
Returns:
448
451
Union[Dict[str, Any], None]: Deployment config to apply to this model.
449
452
"""
453
+ if self .pysdk_model is None :
454
+ self .pysdk_model = self ._create_pre_trained_js_model ()
455
+
450
456
return self .pysdk_model .deployment_config
451
457
452
458
def display_benchmark_metrics (self ):
453
459
"""Display Markdown Benchmark Metrics for deployment configs."""
460
+ if self .pysdk_model is None :
461
+ self .pysdk_model = self ._create_pre_trained_js_model ()
462
+
454
463
self .pysdk_model .display_benchmark_metrics ()
455
464
456
465
def list_deployment_configs (self ) -> List [Dict [str , Any ]]:
@@ -459,6 +468,9 @@ def list_deployment_configs(self) -> List[Dict[str, Any]]:
459
468
Returns:
460
469
List[Dict[str, Any]]: A list of deployment configs.
461
470
"""
471
+ if self .pysdk_model is None :
472
+ self .pysdk_model = self ._create_pre_trained_js_model ()
473
+
462
474
return self .pysdk_model .list_deployment_configs ()
463
475
464
476
def _build_for_jumpstart (self ):
@@ -467,7 +479,11 @@ def _build_for_jumpstart(self):
467
479
self .secret_key = None
468
480
self .jumpstart = True
469
481
470
- pysdk_model = self ._create_pre_trained_js_model ()
482
+ pysdk_model = (
483
+ self .pysdk_model
484
+ if self .pysdk_model is not None
485
+ else self ._create_pre_trained_js_model ()
486
+ )
471
487
472
488
image_uri = pysdk_model .image_uri
473
489
0 commit comments