| | |
| | | |
| | | |
| | | def build_pretrain_model(args): |
| | | if args.model_name == "data2vec": |
| | | # frontend |
| | | if args.input_size is None: |
| | | frontend_class = frontend_choices.get_class(args.frontend) |
| | |
| | | **args.encoder_conf, |
| | | ) |
| | | |
| | | if args.model_name == "data2vec": |
| | | model_class = model_choices.get_class("data2vec") |
| | | model = model_class( |
| | | frontend=frontend, |
| | |
| | | normalize=normalize, |
| | | encoder=encoder, |
| | | ) |
| | | else: |
| | | raise NotImplementedError("Not supported model: {}".format(args.model)) |
| | | |
| | | # 7. Initialize |
| | | # initialize |
| | | if args.init is not None: |
| | | initialize(model, args.init) |
| | | |