Skip to content

Commit

Permalink
log: add warning if base model provided but not valid
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasNeugebauer committed Nov 22, 2024
1 parent bb02cce commit 0a2f8b0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions learning_loop_node/trainer/trainer_logic_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,16 @@ async def _download_model(self) -> None:
The downloaded model.json file is renamed to base_model.json because a new model.json will be created during training.
"""
base_model_uuid = self.training.base_model_uuid
base_model_uuid_is_none = base_model_uuid is None
base_model_uuid_is_valid = is_valid_uuid4(base_model_uuid)

# TODO this checks if we continue a training -> make more explicit
if not base_model_uuid or not is_valid_uuid4(base_model_uuid):
logger.info('skipping model download. No base model provided (in form of uuid): %s', base_model_uuid)
if not base_model_uuid_is_none and not base_model_uuid_is_valid:
logger.warning(
'base model uuid was provided but was not valid (base_model_uuid: %s).\nSkipping download and starting training from scratch.', base_model_uuid)
return

if base_model_uuid_is_none:
logger.info('No base model provided (base_model_uuid: %s).\nStarting training from scratch.', base_model_uuid)
return

logger.info('loading model from Learning Loop')
Expand Down

0 comments on commit 0a2f8b0

Please sign in to comment.