Skip to content

Updating run_swag script for new pytorch_transformers setup #931

@yakazimir

Description

@yakazimir

https://github.com/huggingface/pytorch-transformers/blob/f2a3eb987e1fc2c85320fc3849c67811f5736b50/examples/single_model_scripts/run_swag.py#L35

It appears that WEIGHTS_NAME and CONFIG_NAME have moved out of {pytorch_transformers/pytorch_pretrained_bert}.file_utils (and instead can be imported directly from pytorch_transformers), as shown below :

>>> import pytorch_transformers as p
>>> p.__version__
'1.0.0'
>>> from pytorch_transformers.file_utils import WEIGHTS_NAME, CONFIG_NAME
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'WEIGHTS_NAME'
>>> from pytorch_transformers.file_utils import CONFIG_NAME
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'CONFIG_NAME'
>>> from pytorch_transformers import WEIGHTS_NAME
>>> 

This seems incorrect in the new run_swag script (as shown above) (if true, are there any other important imports that were overlooked here?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions