@@ -1742,20 +1742,43 @@ def from_json(self, json_obj: Dict[str, Any]) -> None:
1742
1742
if json_obj .get ("inference_config_rankings" )
1743
1743
else None
1744
1744
)
1745
- inference_configs_dict : Optional [Dict [str , JumpStartMetadataConfig ]] = (
1746
- {
1747
- alias : JumpStartMetadataConfig (
1748
- alias ,
1749
- config ,
1750
- json_obj ,
1751
- config .config_components ,
1752
- is_hub_content = self ._is_hub_content ,
1753
- )
1754
- for alias , config in json_obj ["inference_configs" ]["configs" ].items ()
1755
- }
1756
- if json_obj .get ("inference_configs" )
1757
- else None
1758
- )
1745
+
1746
+ if self ._is_hub_content :
1747
+ inference_configs_dict : Optional [Dict [str , JumpStartMetadataConfig ]] = (
1748
+ {
1749
+ alias : JumpStartMetadataConfig (
1750
+ alias ,
1751
+ config ,
1752
+ json_obj ,
1753
+ config .config_components ,
1754
+ is_hub_content = self ._is_hub_content ,
1755
+ )
1756
+ for alias , config in json_obj ["inference_configs" ]["configs" ].items ()
1757
+ }
1758
+ if json_obj .get ("inference_configs" )
1759
+ else None
1760
+ )
1761
+ else :
1762
+ inference_configs_dict : Optional [Dict [str , JumpStartMetadataConfig ]] = (
1763
+ {
1764
+ alias : JumpStartMetadataConfig (
1765
+ alias ,
1766
+ config ,
1767
+ json_obj ,
1768
+ (
1769
+ {
1770
+ component_name : self .inference_config_components .get (component_name )
1771
+ for component_name in config .get ("component_names" )
1772
+ }
1773
+ if config and config .get ("component_names" )
1774
+ else None
1775
+ ),
1776
+ )
1777
+ for alias , config in json_obj ["inference_configs" ].items ()
1778
+ }
1779
+ if json_obj .get ("inference_configs" )
1780
+ else None
1781
+ )
1759
1782
1760
1783
self .inference_configs : Optional [JumpStartMetadataConfigs ] = (
1761
1784
JumpStartMetadataConfigs (
0 commit comments