Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] add copied from in test files when adding new model like #27886

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/transformers/commands/add_new_model_like.py
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,7 @@ def create_new_model_like(
model_type (`str`): The model type to duplicate (like "bert" or "gpt2")
new_model_patterns (`ModelPatterns`): The patterns for the new model.
add_copied_from (`bool`, *optional*, defaults to `True`):
Whether or not to add "Copied from" statements to all classes in the new model modeling files.
Whether or not to add "Copied from" statements to all classes in the new model modeling files and testing files.
frameworks (`List[str]`, *optional*):
If passed, will limit the duplicate to the frameworks specified.
old_checkpoint (`str`, *optional*):
Expand Down Expand Up @@ -1442,7 +1442,7 @@ def disable_fx_test(filename: Path) -> bool:
old_model_patterns,
new_model_patterns,
dest_file=dest_file,
add_copied_from=False,
add_copied_from=add_copied_from and "modeling" in new_module_name,
attrs_to_remove=["pipeline_model_mapping", "is_pipeline_test_to_skip"],
)
disabled_fx_test = disabled_fx_test | disable_fx_test(dest_file)
Expand Down
Loading