Created
March 18, 2020 15:35
-
-
Save williamFalcon/249963ad8dd44413ef1c767bd6b4c3b6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytorch_lightning as pl | |
class MyAPICallback(pl.Callback): | |
def on_init_start(self, trainer): | |
requests.post('model started') | |
def on_init_end(self, trainer): | |
def on_train_end(self, trainer, pl_module): | |
data = requests.get('/new_data/or/something') | |
save(data) | |
... | |
# pass to trainer | |
trainer = pl.Trainer(callbacks=[MyPrintingCallback()]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment