(cls, args, **kwargs)
| 53 | |
| 54 | @classmethod |
| 55 | def setup_task(cls, args, **kwargs): |
| 56 | data_cfg = S2TDataConfig(op.join(args.data, args.config_yaml)) |
| 57 | dict_path = op.join(args.data, data_cfg.vocab_filename) |
| 58 | if not op.isfile(dict_path): |
| 59 | raise FileNotFoundError(f"Dict not found: {dict_path}") |
| 60 | tgt_dict = Dictionary.load(dict_path) |
| 61 | logger.info( |
| 62 | f"dictionary size ({data_cfg.vocab_filename}): " f"{len(tgt_dict):,}" |
| 63 | ) |
| 64 | |
| 65 | if getattr(args, "train_subset", None) is not None: |
| 66 | if not all(s.startswith("train") for s in args.train_subset.split(",")): |
| 67 | raise ValueError('Train splits should be named like "train*".') |
| 68 | return cls(args, tgt_dict) |
| 69 | |
| 70 | def build_criterion(self, args): |
| 71 | from fairseq import criterions |
nothing calls this directly
no test coverage detected