Skip to content

Commit

Permalink
Reuse "if not" logic in image_processing.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanluxianshen committed Dec 23, 2024
1 parent 93aafdc commit 1524b83
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/transformers/image_processing_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,6 @@ def get_image_processor_dict(
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
Expand All @@ -391,6 +389,7 @@ def get_image_processor_dict(
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
Expand Down

0 comments on commit 1524b83

Please sign in to comment.