@@ -728,6 +728,9 @@ def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union[str, os.P
728728 " dispatching. Please make sure to set `low_cpu_mem_usage=True`."
729729 )
730730
731+ if dduf_file and custom_pipeline :
732+ raise NotImplementedError ("Custom pipelines are not supported with DDUF at the moment." )
733+
731734 # 1. Download the checkpoints and configs
732735 # use snapshot download here to get it working from from_pretrained
733736 if not os .path .isdir (pretrained_model_name_or_path ):
@@ -1325,6 +1328,9 @@ def download(cls, pretrained_model_name, **kwargs) -> Union[str, os.PathLike]:
13251328 trust_remote_code = kwargs .pop ("trust_remote_code" , False )
13261329 dduf_file : Optional [Dict [str , DDUFEntry ]] = kwargs .pop ("dduf_file" , None )
13271330
1331+ if dduf_file and custom_pipeline :
1332+ raise NotImplementedError ("Custom pipelines are not supported with DDUF at the moment." )
1333+
13281334 allow_pickle = False
13291335 if use_safetensors is None :
13301336 use_safetensors = True
@@ -1488,7 +1494,7 @@ def download(cls, pretrained_model_name, **kwargs) -> Union[str, os.PathLike]:
14881494 return snapshot_folder
14891495
14901496 user_agent = {"pipeline_class" : cls .__name__ }
1491- if not dduf_file and custom_pipeline is not None and not custom_pipeline .endswith (".py" ):
1497+ if custom_pipeline is not None and not custom_pipeline .endswith (".py" ):
14921498 user_agent ["custom_pipeline" ] = custom_pipeline
14931499
14941500 # download all allow_patterns - ignore_patterns
0 commit comments