06c9cefed73cfd43f9453c616e1b9d3ef63f58cf,fairseq/models/speech_to_text/s2t_transformer.py,S2TTransformerModel,build_encoder,#Any#Any#,204

Before Change


    @classmethod
    def build_encoder(cls, args):
        encoder = S2TTransformerEncoder(args)
        if getattr(args, "load_pretrained_encoder_from", None):
            encoder = checkpoint_utils.load_pretrained_component_from_model(
                component=encoder, checkpoint=args.load_pretrained_encoder_from
            )

After Change


    @classmethod
    def build_encoder(cls, args):
        encoder = S2TTransformerEncoder(args)
        pretraining_path = getattr(args, "load_pretrained_encoder_from", None)
        if pretraining_path is not None:
            if not Path(pretraining_path).exists():
                logger.warning(
                    f"skipped pretraining because {pretraining_path} does not exist"
                )
            else:
                encoder = checkpoint_utils.load_pretrained_component_from_model(
                    component=encoder, checkpoint=pretraining_path
                )
                logger.info(f"loaded pretrained encoder from: {pretraining_path}")
        return encoder

    @classmethod
    def build_decoder(cls, args, task, embed_tokens):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: pytorch/fairseq
Commit Name: 06c9cefed73cfd43f9453c616e1b9d3ef63f58cf
Time: 2021-03-25
Author: changhan@fb.com
File Name: fairseq/models/speech_to_text/s2t_transformer.py
Class Name: S2TTransformerModel
Method Name: build_encoder


Project Name: pantsbuild/pants
Commit Name: f0a123d479b194a2dc229eb96c87abec23821791
Time: 2015-12-09
Author: sameer@creativedestruction.com
File Name: src/python/pants/task/testrunner_task_mixin.py
Class Name: TestRunnerTaskMixin
Method Name: _timeout_for_target


Project Name: pantsbuild/pants
Commit Name: ece33b61bb50fc2f0e651a3f1b0a9db95cb1b07a
Time: 2019-12-16
Author: tansy.arron@gmail.com
File Name: src/python/pants/backend/python/rules/python_test_runner.py
Class Name:
Method Name: run_python_test


Project Name: biolab/orange3
Commit Name: c073de4002f7a72babc8fd6ecdcd90c141be2c08
Time: 2013-01-21
Author: janez.demsar@fri.uni-lj.si
File Name: Orange/widgets/utils/datacaching.py
Class Name:
Method Name: getCached