Commit c6bf1a40 authored by thomwolf's avatar thomwolf
Browse files

fix test examples et model pretrained

parent 92a782b1
......@@ -56,7 +56,8 @@ class ExamplesTests(unittest.TestCase):
"--learning_rate=1e-4",
"--max_steps=10",
"--warmup_steps=2",
"--overwrite_output_dir"]
"--overwrite_output_dir",
"--seed=42"]
model_name = "--model_name=bert-base-uncased"
with patch.object(sys, 'argv', testargs + [model_name]):
result = run_glue.main()
......
......@@ -49,7 +49,7 @@ class PretrainedConfig(object):
self.torchscript = kwargs.pop('torchscript', False)
@classmethod
def from_pretrained(cls, pretrained_model_name_or_path, **kwargs):
def from_pretrained(cls, pretrained_model_name_or_path, *input, **kwargs):
"""
Instantiate a PretrainedConfig from a pre-trained model configuration.
......
......@@ -30,6 +30,7 @@ class ModelUtilsTest(unittest.TestCase):
self.assertIsNotNone(config)
self.assertIsInstance(config, PretrainedConfig)
model = BertModel.from_pretrained(model_name)
model, loading_info = BertModel.from_pretrained(model_name, output_loading_info=True)
self.assertIsNotNone(model)
self.assertIsInstance(model, PreTrainedModel)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment