meerqat.train.callbacks module#

class meerqat.train.callbacks.TestAfterFit(data_update: Optional[dict] = None)[source]#

Bases: Callback

Calls trainer.test with ‘best’ ckpt on fit end (so make sure you configure ModelCheckpoint to save best model).

Parameters:

data_update (dict, optional) –

Arguments of trainer.datamodule to update before running test I.e. differences between your validation and test setups E.g. for re-ranking, you might want to pass: {

”M”: 100, # re-rank top-100 passages “eval_batch_size”: 2, # lower batch size to fit in a GPU “run_path”: “/path/to/test/run.json”, “qrels_path”: “/path/to/test/qrels.json”

}

on_fit_end(trainer, pl_module)[source]#

Called when fit ends.