"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "2b11fa51742e900c7afb2e698006bbb7ada24272"
Unverified Commit 9924df9e authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

Avoid unnecessary warnings when loading `CLIPConfig` (#28108)



* fix

---------
Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
parent 7938c8c8
...@@ -339,7 +339,7 @@ class AltCLIPConfig(PretrainedConfig): ...@@ -339,7 +339,7 @@ class AltCLIPConfig(PretrainedConfig):
f"`text_config_dict` is provided which will be used to initialize `AltCLIPTextConfig`. The " f"`text_config_dict` is provided which will be used to initialize `AltCLIPTextConfig`. The "
f'value `text_config["{key}"]` will be overriden.' 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`. # Update all values in `text_config` with the ones in `_text_config_dict`.
text_config.update(_text_config_dict) text_config.update(_text_config_dict)
...@@ -371,7 +371,7 @@ class AltCLIPConfig(PretrainedConfig): ...@@ -371,7 +371,7 @@ class AltCLIPConfig(PretrainedConfig):
f"`vision_config_dict` is provided which will be used to initialize `AltCLIPVisionConfig`. " f"`vision_config_dict` is provided which will be used to initialize `AltCLIPVisionConfig`. "
f'The value `vision_config["{key}"]` will be overriden.' 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`. # Update all values in `vision_config` with the ones in `_vision_config_dict`.
vision_config.update(_vision_config_dict) vision_config.update(_vision_config_dict)
......
...@@ -360,7 +360,7 @@ class ChineseCLIPConfig(PretrainedConfig): ...@@ -360,7 +360,7 @@ class ChineseCLIPConfig(PretrainedConfig):
f"`text_config_dict` is provided which will be used to initialize `ChineseCLIPTextConfig`. " f"`text_config_dict` is provided which will be used to initialize `ChineseCLIPTextConfig`. "
f'The value `text_config["{key}"]` will be overriden.' 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`. # Update all values in `text_config` with the ones in `_text_config_dict`.
text_config.update(_text_config_dict) text_config.update(_text_config_dict)
...@@ -392,7 +392,7 @@ class ChineseCLIPConfig(PretrainedConfig): ...@@ -392,7 +392,7 @@ class ChineseCLIPConfig(PretrainedConfig):
f"`vision_config_dict` is provided which will be used to initialize " f"`vision_config_dict` is provided which will be used to initialize "
f'`ChineseCLIPVisionConfig`. The value `vision_config["{key}"]` will be overriden.' 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`. # Update all values in `vision_config` with the ones in `_vision_config_dict`.
vision_config.update(_vision_config_dict) vision_config.update(_vision_config_dict)
......
...@@ -347,7 +347,7 @@ class CLIPConfig(PretrainedConfig): ...@@ -347,7 +347,7 @@ class CLIPConfig(PretrainedConfig):
f"`text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The " f"`text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The "
f'value `text_config["{key}"]` will be overriden.' 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`. # Update all values in `text_config` with the ones in `_text_config_dict`.
text_config.update(_text_config_dict) text_config.update(_text_config_dict)
...@@ -379,7 +379,7 @@ class CLIPConfig(PretrainedConfig): ...@@ -379,7 +379,7 @@ class CLIPConfig(PretrainedConfig):
f"`vision_config_dict` is provided which will be used to initialize `CLIPVisionConfig`. " f"`vision_config_dict` is provided which will be used to initialize `CLIPVisionConfig`. "
f'The value `vision_config["{key}"]` will be overriden.' 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`. # Update all values in `vision_config` with the ones in `_vision_config_dict`.
vision_config.update(_vision_config_dict) vision_config.update(_vision_config_dict)
......
...@@ -360,7 +360,7 @@ class CLIPSegConfig(PretrainedConfig): ...@@ -360,7 +360,7 @@ class CLIPSegConfig(PretrainedConfig):
f"`text_config_dict` is provided which will be used to initialize `CLIPSegTextConfig`. The " f"`text_config_dict` is provided which will be used to initialize `CLIPSegTextConfig`. The "
f'value `text_config["{key}"]` will be overriden.' 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`. # Update all values in `text_config` with the ones in `_text_config_dict`.
text_config.update(_text_config_dict) text_config.update(_text_config_dict)
...@@ -392,7 +392,7 @@ class CLIPSegConfig(PretrainedConfig): ...@@ -392,7 +392,7 @@ class CLIPSegConfig(PretrainedConfig):
f"`vision_config_dict` is provided which will be used to initialize `CLIPSegVisionConfig`. " f"`vision_config_dict` is provided which will be used to initialize `CLIPSegVisionConfig`. "
f'The value `vision_config["{key}"]` will be overriden.' 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`. # Update all values in `vision_config` with the ones in `_vision_config_dict`.
vision_config.update(_vision_config_dict) vision_config.update(_vision_config_dict)
......
...@@ -596,7 +596,7 @@ class FlavaConfig(PretrainedConfig): ...@@ -596,7 +596,7 @@ class FlavaConfig(PretrainedConfig):
f"`text_config_dict` is provided which will be used to initialize `FlavaTextConfig`. The " f"`text_config_dict` is provided which will be used to initialize `FlavaTextConfig`. The "
f'value `text_config["{key}"]` will be overriden.' 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`. # Update all values in `text_config` with the ones in `_text_config_dict`.
text_config.update(_text_config_dict) text_config.update(_text_config_dict)
...@@ -628,7 +628,7 @@ class FlavaConfig(PretrainedConfig): ...@@ -628,7 +628,7 @@ class FlavaConfig(PretrainedConfig):
f"`image_config_dict` is provided which will be used to initialize `FlavaImageConfig`. " f"`image_config_dict` is provided which will be used to initialize `FlavaImageConfig`. "
f'The value `image_config["{key}"]` will be overriden.' 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`. # Update all values in `image_config` with the ones in `_image_config_dict`.
image_config.update(_image_config_dict) image_config.update(_image_config_dict)
...@@ -660,7 +660,7 @@ class FlavaConfig(PretrainedConfig): ...@@ -660,7 +660,7 @@ class FlavaConfig(PretrainedConfig):
f"`multimodal_config_dict` is provided which will be used to initialize " f"`multimodal_config_dict` is provided which will be used to initialize "
f'`FlavaMultimodalConfig`. The value `multimodal_config["{key}"]` will be overriden.' 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`. # Update all values in `multimodal_config` with the ones in `_multimodal_config_dict`.
multimodal_config.update(_multimodal_config_dict) multimodal_config.update(_multimodal_config_dict)
...@@ -693,7 +693,7 @@ class FlavaConfig(PretrainedConfig): ...@@ -693,7 +693,7 @@ class FlavaConfig(PretrainedConfig):
f"`image_codebook_config_dict` is provided which will be used to initialize " f"`image_codebook_config_dict` is provided which will be used to initialize "
f'`FlavaImageCodebookConfig`. The value `image_codebook_config["{key}"]` will be overriden.' 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`. # Update all values in `image_codebook_config` with the ones in `_image_codebook_config_dict`.
image_codebook_config.update(_image_codebook_config_dict) image_codebook_config.update(_image_codebook_config_dict)
......
...@@ -339,7 +339,7 @@ class GroupViTConfig(PretrainedConfig): ...@@ -339,7 +339,7 @@ class GroupViTConfig(PretrainedConfig):
f"`text_config_dict` is provided which will be used to initialize `GroupViTTextConfig`. " f"`text_config_dict` is provided which will be used to initialize `GroupViTTextConfig`. "
f'The value `text_config["{key}"]` will be overriden.' 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`. # Update all values in `text_config` with the ones in `_text_config_dict`.
text_config.update(_text_config_dict) text_config.update(_text_config_dict)
...@@ -371,7 +371,7 @@ class GroupViTConfig(PretrainedConfig): ...@@ -371,7 +371,7 @@ class GroupViTConfig(PretrainedConfig):
f"`vision_config_dict` is provided which will be used to initialize `GroupViTVisionConfig`." f"`vision_config_dict` is provided which will be used to initialize `GroupViTVisionConfig`."
f' The value `vision_config["{key}"]` will be overriden.' 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`. # Update all values in `vision_config` with the ones in `_vision_config_dict`.
vision_config.update(_vision_config_dict) vision_config.update(_vision_config_dict)
......
...@@ -347,7 +347,7 @@ class XCLIPConfig(PretrainedConfig): ...@@ -347,7 +347,7 @@ class XCLIPConfig(PretrainedConfig):
f"`text_config_dict` is provided which will be used to initialize `XCLIPTextConfig`. The " f"`text_config_dict` is provided which will be used to initialize `XCLIPTextConfig`. The "
f'value `text_config["{key}"]` will be overriden.' 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`. # Update all values in `text_config` with the ones in `_text_config_dict`.
text_config.update(_text_config_dict) text_config.update(_text_config_dict)
...@@ -379,7 +379,7 @@ class XCLIPConfig(PretrainedConfig): ...@@ -379,7 +379,7 @@ class XCLIPConfig(PretrainedConfig):
f"`vision_config_dict` is provided which will be used to initialize `XCLIPVisionConfig`. " f"`vision_config_dict` is provided which will be used to initialize `XCLIPVisionConfig`. "
f'The value `vision_config["{key}"]` will be overriden.' 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`. # Update all values in `vision_config` with the ones in `_vision_config_dict`.
vision_config.update(_vision_config_dict) vision_config.update(_vision_config_dict)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment