Skip to content

Commit

Permalink
Avoid unnecessary warnings when loading CLIPConfig (#28108)
Browse files Browse the repository at this point in the history
* fix

---------

Co-authored-by: ydshieh <[email protected]>
  • Loading branch information
ydshieh and ydshieh authored Dec 20, 2023
1 parent 7938c8c commit 9924df9
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/transformers/models/altclip/configuration_altclip.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def __init__(
f"`text_config_dict` is provided which will be used to initialize `AltCLIPTextConfig`. The "
f'value `text_config["{key}"]` will be overriden.'
)
logger.warning(message)
logger.info(message)

# Update all values in `text_config` with the ones in `_text_config_dict`.
text_config.update(_text_config_dict)
Expand Down Expand Up @@ -371,7 +371,7 @@ def __init__(
f"`vision_config_dict` is provided which will be used to initialize `AltCLIPVisionConfig`. "
f'The value `vision_config["{key}"]` will be overriden.'
)
logger.warning(message)
logger.info(message)

# Update all values in `vision_config` with the ones in `_vision_config_dict`.
vision_config.update(_vision_config_dict)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def __init__(
f"`text_config_dict` is provided which will be used to initialize `ChineseCLIPTextConfig`. "
f'The value `text_config["{key}"]` will be overriden.'
)
logger.warning(message)
logger.info(message)

# Update all values in `text_config` with the ones in `_text_config_dict`.
text_config.update(_text_config_dict)
Expand Down Expand Up @@ -392,7 +392,7 @@ def __init__(
f"`vision_config_dict` is provided which will be used to initialize "
f'`ChineseCLIPVisionConfig`. The value `vision_config["{key}"]` will be overriden.'
)
logger.warning(message)
logger.info(message)

# Update all values in `vision_config` with the ones in `_vision_config_dict`.
vision_config.update(_vision_config_dict)
Expand Down
4 changes: 2 additions & 2 deletions src/transformers/models/clip/configuration_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def __init__(
f"`text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The "
f'value `text_config["{key}"]` will be overriden.'
)
logger.warning(message)
logger.info(message)

# Update all values in `text_config` with the ones in `_text_config_dict`.
text_config.update(_text_config_dict)
Expand Down Expand Up @@ -379,7 +379,7 @@ def __init__(
f"`vision_config_dict` is provided which will be used to initialize `CLIPVisionConfig`. "
f'The value `vision_config["{key}"]` will be overriden.'
)
logger.warning(message)
logger.info(message)

# Update all values in `vision_config` with the ones in `_vision_config_dict`.
vision_config.update(_vision_config_dict)
Expand Down
4 changes: 2 additions & 2 deletions src/transformers/models/clipseg/configuration_clipseg.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def __init__(
f"`text_config_dict` is provided which will be used to initialize `CLIPSegTextConfig`. The "
f'value `text_config["{key}"]` will be overriden.'
)
logger.warning(message)
logger.info(message)

# Update all values in `text_config` with the ones in `_text_config_dict`.
text_config.update(_text_config_dict)
Expand Down Expand Up @@ -392,7 +392,7 @@ def __init__(
f"`vision_config_dict` is provided which will be used to initialize `CLIPSegVisionConfig`. "
f'The value `vision_config["{key}"]` will be overriden.'
)
logger.warning(message)
logger.info(message)

# Update all values in `vision_config` with the ones in `_vision_config_dict`.
vision_config.update(_vision_config_dict)
Expand Down
8 changes: 4 additions & 4 deletions src/transformers/models/flava/configuration_flava.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ def __init__(
f"`text_config_dict` is provided which will be used to initialize `FlavaTextConfig`. The "
f'value `text_config["{key}"]` will be overriden.'
)
logger.warning(message)
logger.info(message)

# Update all values in `text_config` with the ones in `_text_config_dict`.
text_config.update(_text_config_dict)
Expand Down Expand Up @@ -628,7 +628,7 @@ def __init__(
f"`image_config_dict` is provided which will be used to initialize `FlavaImageConfig`. "
f'The value `image_config["{key}"]` will be overriden.'
)
logger.warning(message)
logger.info(message)

# Update all values in `image_config` with the ones in `_image_config_dict`.
image_config.update(_image_config_dict)
Expand Down Expand Up @@ -660,7 +660,7 @@ def __init__(
f"`multimodal_config_dict` is provided which will be used to initialize "
f'`FlavaMultimodalConfig`. The value `multimodal_config["{key}"]` will be overriden.'
)
logger.warning(message)
logger.info(message)

# Update all values in `multimodal_config` with the ones in `_multimodal_config_dict`.
multimodal_config.update(_multimodal_config_dict)
Expand Down Expand Up @@ -693,7 +693,7 @@ def __init__(
f"`image_codebook_config_dict` is provided which will be used to initialize "
f'`FlavaImageCodebookConfig`. The value `image_codebook_config["{key}"]` will be overriden.'
)
logger.warning(message)
logger.info(message)

# Update all values in `image_codebook_config` with the ones in `_image_codebook_config_dict`.
image_codebook_config.update(_image_codebook_config_dict)
Expand Down
4 changes: 2 additions & 2 deletions src/transformers/models/groupvit/configuration_groupvit.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def __init__(
f"`text_config_dict` is provided which will be used to initialize `GroupViTTextConfig`. "
f'The value `text_config["{key}"]` will be overriden.'
)
logger.warning(message)
logger.info(message)

# Update all values in `text_config` with the ones in `_text_config_dict`.
text_config.update(_text_config_dict)
Expand Down Expand Up @@ -371,7 +371,7 @@ def __init__(
f"`vision_config_dict` is provided which will be used to initialize `GroupViTVisionConfig`."
f' The value `vision_config["{key}"]` will be overriden.'
)
logger.warning(message)
logger.info(message)

# Update all values in `vision_config` with the ones in `_vision_config_dict`.
vision_config.update(_vision_config_dict)
Expand Down
4 changes: 2 additions & 2 deletions src/transformers/models/x_clip/configuration_x_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def __init__(
f"`text_config_dict` is provided which will be used to initialize `XCLIPTextConfig`. The "
f'value `text_config["{key}"]` will be overriden.'
)
logger.warning(message)
logger.info(message)

# Update all values in `text_config` with the ones in `_text_config_dict`.
text_config.update(_text_config_dict)
Expand Down Expand Up @@ -379,7 +379,7 @@ def __init__(
f"`vision_config_dict` is provided which will be used to initialize `XCLIPVisionConfig`. "
f'The value `vision_config["{key}"]` will be overriden.'
)
logger.warning(message)
logger.info(message)

# Update all values in `vision_config` with the ones in `_vision_config_dict`.
vision_config.update(_vision_config_dict)
Expand Down

0 comments on commit 9924df9

Please sign in to comment.