Skip to content

Commit

Permalink
Move ui_utils entirely to nn-core (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucmos committed Jan 21, 2022
1 parent cd1c990 commit dba7653
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 114 deletions.
10 changes: 6 additions & 4 deletions src/nn_template/ui/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
import streamlit as st
import wandb

from nn_template.modules.model import MyModel
from nn_template.ui.ui_utils import select_checkpoint
from nn_core.ui import select_checkpoint

from nn_template.pl_modules.pl_module import MyLightningModule


@st.cache(allow_output_mutation=True)
def get_model(checkpoint_path: Path):
return MyModel.load_from_checkpoint(checkpoint_path=str(checkpoint_path))
return MyLightningModule.load_from_checkpoint(checkpoint_path=str(checkpoint_path))


if wandb.api.api_key is None:
Expand All @@ -19,4 +20,5 @@ def get_model(checkpoint_path: Path):
st.sidebar.subheader(f"Logged in W&B as: {wandb.api.viewer()['entity']}")

checkpoint_path = select_checkpoint()
model: MyModel = get_model(checkpoint_path=checkpoint_path)
model: MyLightningModule = get_model(checkpoint_path=checkpoint_path)
model
110 changes: 0 additions & 110 deletions src/nn_template/ui/ui_utils.py

This file was deleted.

0 comments on commit dba7653

Please sign in to comment.