Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Fix serve sanity checking #493

Merged
merged 2 commits into from
Jun 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
### Fixed


- Fixed a bug where serve sanity checking would not be triggered using the latest PyTorchLightning version ([#493](https://github.com/PyTorchLightning/lightning-flash/pull/493))


## [0.4.0] - 2021-06-22

### Added
Expand Down
9 changes: 8 additions & 1 deletion flash/core/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,15 @@ def __init__(self, *args, serve_sanity_check: bool = False, **kwargs):

self.serve_sanity_check = serve_sanity_check

def _run_sanity_check(self, ref_model):
if hasattr(super(), "_run_sanity_check"):
super()._run_sanity_check(ref_model)

self.run_sanity_check(ref_model)

def run_sanity_check(self, ref_model):
super().run_sanity_check(ref_model)
if hasattr(super(), "run_sanity_check"):
super().run_sanity_check(ref_model)

if self.serve_sanity_check and ref_model.is_servable and _SERVE_AVAILABLE:
ref_model.run_serve_sanity_check()
Expand Down