Skip to content

Commit

Permalink
Py35 doesn't like inline variable types
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-c committed Jan 13, 2020
1 parent b803b06 commit 3c86b6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ known_third_party =
tensorboardX
tensorflow
tensorflow_datasets
torch
torchtext
torchvision

Expand Down
5 changes: 3 additions & 2 deletions src/transformers/configuration_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class PretrainedConfig(object):
Class attributes (overridden by derived classes):
- ``pretrained_config_archive_map``: a python ``dict`` with `shortcut names` (string) as keys and `url` (string) of associated pretrained model configurations as values.
- ``model_type``: a string that identifies the model type, that we serialize into the JSON file, and that we use to recreate the correct object in :class:`~transformers.AutoConfig`.
Parameters:
``finetuning_task``: string, default `None`. Name of the task used to fine-tune the model. This can be used when converting from an original (TensorFlow or PyTorch) checkpoint.
Expand All @@ -46,8 +47,8 @@ class PretrainedConfig(object):
``output_hidden_states``: string, default `False`. Should the model returns all hidden-states.
``torchscript``: string, default `False`. Is the model used with Torchscript.
"""
pretrained_config_archive_map: Dict[str, str] = {}
model_type: str
pretrained_config_archive_map = {} # type: Dict[str, str]
model_type = "" # type: str

def __init__(self, **kwargs):
# Attributes with defaults
Expand Down

0 comments on commit 3c86b6f

Please sign in to comment.