Reuse "if not" logic in image_processing. (#35405)

This commit is contained in:
湛露先生 2025-01-03 21:44:57 +08:00 committed by GitHub
parent 30a9971632
commit 1fe2d53d4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -381,8 +381,6 @@ class ImageProcessingMixin(PushToHubMixin):
logger.info(
f"loading configuration file {image_processor_file} from cache at {resolved_image_processor_file}"
)
if not is_local:
if "auto_map" in image_processor_dict:
image_processor_dict["auto_map"] = add_model_info_to_auto_map(
image_processor_dict["auto_map"], pretrained_model_name_or_path
@ -391,6 +389,7 @@ class ImageProcessingMixin(PushToHubMixin):
image_processor_dict["custom_pipelines"] = add_model_info_to_custom_pipelines(
image_processor_dict["custom_pipelines"], pretrained_model_name_or_path
)
return image_processor_dict, kwargs
@classmethod