c0c834e3bd880f89e36ff1748623456fb98507e9,tests/models/test_mmbt.py,TestMMBTTorchscript,setUp,#TestMMBTTorchscript#,24

Before Change


        args = test_utils.dummy_args(model=model_name)
        configuration = Configuration(args)
        config = configuration.get_config()
        model_class = registry.get_model_class(model_name)
        config.model_config[model_name]["training_head_type"] = "classification"
        config.model_config[model_name]["num_labels"] = 2
        self.finetune_model = model_class(config.model_config[model_name])
        self.finetune_model.build()

    def test_load_save_finetune_model(self):
        self.assertTrue(test_utils.verify_torchscript_models(self.finetune_model))

After Change


    def setUp(self):
        test_utils.setup_proxy()
        setup_imports()
        model_name = "mmbt"
        args = test_utils.dummy_args(model=model_name)
        configuration = Configuration(args)
        config = configuration.get_config()
        model_config = config.model_config[model_name]
        model_config["training_head_type"] = "classification"
        model_config["num_labels"] = 2
        model_config.model = model_name
        self.finetune_model = build_model(model_config)

    def test_load_save_finetune_model(self):
        self.assertTrue(test_utils.verify_torchscript_models(self.finetune_model))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 21

Instances


Project Name: facebookresearch/pythia
Commit Name: c0c834e3bd880f89e36ff1748623456fb98507e9
Time: 2020-10-19
Author: apsdehal@gmail.com
File Name: tests/models/test_mmbt.py
Class Name: TestMMBTTorchscript
Method Name: setUp


Project Name: facebookresearch/pythia
Commit Name: c0c834e3bd880f89e36ff1748623456fb98507e9
Time: 2020-10-19
Author: apsdehal@gmail.com
File Name: tests/models/test_visual_bert.py
Class Name: TestVisualBertTorchscript
Method Name: setUp


Project Name: facebookresearch/pythia
Commit Name: c0c834e3bd880f89e36ff1748623456fb98507e9
Time: 2020-10-19
Author: apsdehal@gmail.com
File Name: tests/models/test_vilbert.py
Class Name: TestViLBertTorchscript
Method Name: setUp


Project Name: facebookresearch/pythia
Commit Name: c0c834e3bd880f89e36ff1748623456fb98507e9
Time: 2020-10-19
Author: apsdehal@gmail.com
File Name: tests/models/test_mmbt.py
Class Name: TestMMBTTorchscript
Method Name: setUp