I’m trying to add a new model to transformers by making a copy of T5 model and adding some tweaks. However, the command make repo-consistency
fails on my tweaks and suggests to revert them! How can I inform the test that some changed lines are intentionally made by me and should remain?
See the error here, and my changes which I intend to keep here.
1 Like
Did you make changes in any check files ?
1 Like
Thank you for your reply @Felicitywood!
Not sure what do you mean by “check files”, but I have run the command transformers add-new-model-like
and selected the T5
as my base model, so it has copied T5 files for me, including the src/transformers/models/t5/modeling_t5.py
which is copied to src/transformers/models/t5la/modeling_t5la.py
and I have changed this copy.
1 Like
The files related to the repo consistency checks
1 Like
Like those scripts that verify changes don’t break the repo. since you copied and made changes to the model, you might need to update or whitelist your new files there so the check doesn’t fail. Did you look into those?/
1 Like
No, I have not changed anywhere except my own model files. Should I change the repo consistency check files? If yes, which file exactly and what change?
There is no mention of such a requirement in the documentation pages like this.
Thanks once again!
1 Like
I managed to resolve the error by removing the # Copied from ...
comment from the top of my model class. Is it an advised workaround? The downside is that I have changed only a few methods within my copy, and I want only those specific methods to be whitelisted, but now the whole class is whitelisted and unchecked against unexpected changes. I can add # Copied from ...
to every single method which I have not changed, but again I’m not sure if it is a good practice or not?
1 Like
That’s a valid workaround, but you’d keep the # Copied from ...
only on unchanged methods.
1 Like
Thank you @Felicitywood!
Another workaround I just found is putting # Ignore copy
in my modified block of code which I want to keep as it is. I’m wondering why these workarounds and the requirement itself are not mentioned in the documentation website?!
1 Like