modular_model_converter
can not handle objects import via try - except
#35414
Labels
modular_model_converter
can not handle objects import via try - except
#35414
System Info
transformers 4.48.0.dev0 d8c1db2
Who can help?
@ArthurZucker
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
How to reproduce?
git clone [email protected]:huggingface/transformers.git && cd transformers && git checkout d8c1db2f568d4bcc254bc046036acf0d6bba8373
Create a new folder named
xxx_model
insrc/transformers/models/
Inside this folder, create a new Python file called
modular_xxx.py
with the following content:python utils/modular_model_converter.py --files_to_parse src/transformers/models/xxx_model/modular_xxx.py
This will generate the modeling file at:
src/transformers/models/xxx_model/modeling_xxx.py
.Expected behavior
Expected vs Actual Contents in src/transformers/models/xxx_model/modeling_xxx.py
The expected contents in
src/transformers/models/xxx_model/modeling_xxx.py
is :However, the actual content generated in
src/transformers/models/xxx_model/modeling_xxx.py
is :Issue
The lines
try: import torch.nn.functional as F except: pass
are missing in the actual content, even though it exists in the original modular file.The text was updated successfully, but these errors were encountered: