"src/include/utility.hpp" did not exist on "79d9b1084b8f65fe6c261483276b791aeb918627"
Commit 64abd3e0 authored by Lysandre's avatar Lysandre Committed by Lysandre Debut
Browse files

Multi-line examples can be tested + ALBERT patch for CircleCI

All tests should now work fine.
parent 83757725
......@@ -79,6 +79,7 @@ class AlbertConfig(PretrainedConfig):
Example::
from transformers import AlbertConfig, AlbertModel
# Initializing an ALBERT-xxlarge style configuration
albert_xxlarge_configuration = AlbertConfig()
......@@ -90,7 +91,7 @@ class AlbertConfig(PretrainedConfig):
)
# Initializing a model from the ALBERT-base style configuration
model = AlbertModel(bert_base_configuration)
model = AlbertModel(albert_xxlarge_configuration)
# Accessing the model configuration
configuration = model.config
......
......@@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import unittest
import os
import unittest
def get_examples_from_file(file):
......@@ -37,7 +37,7 @@ def get_examples_from_file(file):
example_mode = True
example_indentation = line.lower().find("example::")
return examples
return ['\n'.join(example) for example in examples]
class TestCodeExamples(unittest.TestCase):
......@@ -51,8 +51,7 @@ class TestCodeExamples(unittest.TestCase):
print("Testing", configuration_file, str(len(examples)) + "/" + str(len(examples)))
def execute_example(code_example):
for line in code_example:
exec(line)
exec(code_example)
with self.subTest(msg=configuration_file):
[execute_example(code_example) for code_example in examples]
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