From 3c86b6f3c55d32eac6066949c238f3a82c13d376 Mon Sep 17 00:00:00 2001 From: Julien Chaumond Date: Mon, 13 Jan 2020 20:44:33 +0000 Subject: [PATCH] Py35 doesn't like inline variable types --- setup.cfg | 1 + src/transformers/configuration_utils.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 8599fdb6e6..e69f8d5551 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,6 +20,7 @@ known_third_party = tensorboardX tensorflow tensorflow_datasets + torch torchtext torchvision diff --git a/src/transformers/configuration_utils.py b/src/transformers/configuration_utils.py index d87547ea22..6db915e0a4 100644 --- a/src/transformers/configuration_utils.py +++ b/src/transformers/configuration_utils.py @@ -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. @@ -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