examples/research_projects/rag-end2end-retriever/callbacks_rag.py/get_early_stopping_callback
def get_early_stopping_callback(metric, patience):
    return EarlyStopping(
        monitor=f"val_{metric}",  # does this need avg?
        mode="min" if "loss" in metric else "max",
        patience=patience,
        verbose=True,
    )