MCPcopy Index your code
hub / github.com/QData/TextAttack / run

Method run

textattack/commands/train_model_command.py:20–37  ·  view source on GitHub ↗
(self, args)

Source from the content-addressed store, hash-verified

18 """
19
20 def run(self, args):
21 training_args = CommandLineTrainingArgs(**vars(args))
22 model_wrapper = CommandLineTrainingArgs._create_model_from_args(training_args)
23 train_dataset, eval_dataset = CommandLineTrainingArgs._create_dataset_from_args(
24 training_args
25 )
26 attack = CommandLineTrainingArgs._create_attack_from_args(
27 training_args, model_wrapper
28 )
29 trainer = Trainer(
30 model_wrapper,
31 training_args.task_type,
32 attack,
33 train_dataset,
34 eval_dataset,
35 training_args,
36 )
37 trainer.train()
38
39 @staticmethod
40 def register_subcommand(main_parser: ArgumentParser):

Callers

nothing calls this directly

Calls 6

trainMethod · 0.95
TrainerClass · 0.90

Tested by

no test coverage detected