Unverified Commit dcca71be authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

Create dummy models (#19901)



* create dummy models

* quality

* update

* update

* Make Wav2Vec2Conformer work

* style

* deal with models with text_config and vision_config

* apply suggestions

* Composite models

* style

* style

* fix shape issue

* fix shape issue

* For VisionTextDualEncoderModel

* show_progress=False when converting tokenizers

* Fix for OwlViT

* Fix for VisualBert

* Update

* final
Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
parent 4cef546f
...@@ -49,29 +49,35 @@ CONFIG_CLASSES_TO_IGNORE_FOR_DOCSTRING_CHECKPOINT_CHECK = { ...@@ -49,29 +49,35 @@ CONFIG_CLASSES_TO_IGNORE_FOR_DOCSTRING_CHECKPOINT_CHECK = {
} }
def check_config_docstrings_have_checkpoints(): def get_checkpoint_from_config_class(config_class):
configs_without_checkpoint = [] checkpoint = None
for config_class in list(CONFIG_MAPPING.values()): # source code of `config_class`
checkpoint_found = False config_source = inspect.getsource(config_class)
checkpoints = _re_checkpoint.findall(config_source)
for checkpoint in checkpoints:
# Each `checkpoint` is a tuple of a checkpoint name and a checkpoint link.
# For example, `('bert-base-uncased', 'https://huggingface.co/bert-base-uncased')`
ckpt_name, ckpt_link = checkpoint
# verify the checkpoint name corresponds to the checkpoint link
ckpt_link_from_name = f"https://huggingface.co/{ckpt_name}"
if ckpt_link == ckpt_link_from_name:
checkpoint = ckpt_name
break
# source code of `config_class` return checkpoint
config_source = inspect.getsource(config_class)
checkpoints = _re_checkpoint.findall(config_source)
for checkpoint in checkpoints:
# Each `checkpoint` is a tuple of a checkpoint name and a checkpoint link.
# For example, `('bert-base-uncased', 'https://huggingface.co/bert-base-uncased')`
ckpt_name, ckpt_link = checkpoint
# verify the checkpoint name corresponds to the checkpoint link def check_config_docstrings_have_checkpoints():
ckpt_link_from_name = f"https://huggingface.co/{ckpt_name}" configs_without_checkpoint = []
if ckpt_link == ckpt_link_from_name:
checkpoint_found = True for config_class in list(CONFIG_MAPPING.values()):
break checkpoint = get_checkpoint_from_config_class(config_class)
name = config_class.__name__ name = config_class.__name__
if not checkpoint_found and name not in CONFIG_CLASSES_TO_IGNORE_FOR_DOCSTRING_CHECKPOINT_CHECK: if checkpoint is None and name not in CONFIG_CLASSES_TO_IGNORE_FOR_DOCSTRING_CHECKPOINT_CHECK:
configs_without_checkpoint.append(name) configs_without_checkpoint.append(name)
if len(configs_without_checkpoint) > 0: if len(configs_without_checkpoint) > 0:
......
This diff is collapsed.
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