Skip to content

Commit

Permalink
Fix tiny model script: not using from_pt=True (huggingface#27372)
Browse files Browse the repository at this point in the history
fix

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
  • Loading branch information
2 people authored and EduardoPach committed Nov 19, 2023
1 parent 30ed227 commit 3e0227d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/create_dummy_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ def build_composite_models(config_class, output_dir):
model.save_pretrained(model_path)

if tf_model_class is not None:
model = tf_model_class.from_pretrained(model_path, from_pt=True)
model = tf_model_class.from_pretrained(model_path)
model.save_pretrained(model_path)

# copy the processors
Expand Down Expand Up @@ -1204,7 +1204,7 @@ def build(config_class, models_to_create, output_dir):
ckpt = get_checkpoint_dir(output_dir, pt_arch)
# Use the same weights from PyTorch.
try:
model = tensorflow_arch.from_pretrained(ckpt, from_pt=True)
model = tensorflow_arch.from_pretrained(ckpt)
model.save_pretrained(ckpt)
except Exception as e:
# Conversion may fail. Let's not create a model with different weights to avoid confusion (for now).
Expand Down

0 comments on commit 3e0227d

Please sign in to comment.