Spaces:
Runtime error
Runtime error
Download dockformerpp/utils/callbacks.py from MLSB/DockFormerPP: direct link, hf CLI and curl.
- Browser
- Download file 571 Bytes
-
https://huggingface.co/spaces/MLSB/DockFormerPP/resolve/main/dockformerpp/utils/callbacks.py
- Command line
-
hf download hf://spaces/MLSB/DockFormerPP/dockformerpp/utils/callbacks.py
-
curl -L -o callbacks.py https://huggingface.co/spaces/MLSB/DockFormerPP/resolve/main/dockformerpp/utils/callbacks.py
571 Bytes
| from lightning.pytorch.callbacks import EarlyStopping | |
| from lightning_utilities.core.rank_zero import rank_zero_info | |
| class EarlyStoppingVerbose(EarlyStopping): | |
| """ | |
| The default EarlyStopping callback's verbose mode is too verbose. | |
| This class outputs a message only when it's getting ready to stop. | |
| """ | |
| def _evalute_stopping_criteria(self, *args, **kwargs): | |
| should_stop, reason = super()._evalute_stopping_criteria(*args, **kwargs) | |
| if(should_stop): | |
| rank_zero_info(f"{reason}\n") | |
| return should_stop, reason | |