Skip to content

Commit

Permalink
fixup: Format Python code with Black
Browse files Browse the repository at this point in the history
  • Loading branch information
autoblack authored and generall committed Jun 8, 2022
1 parent 072edb6 commit 79243e2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions quaterion/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,13 @@ def trainer_defaults(
# If the cache is enabled and there are no
# trainable encoders - checkpointing on each epoch might become a bottleneck
cache_config = trainable_model.configure_caches()
all_encoders_frozen = all(not encoder.trainable for encoder in trainable_model.model.encoders.values())
cache_configured = cache_config is not None and cache_config.cache_type != CacheType.NONE
all_encoders_frozen = all(
not encoder.trainable
for encoder in trainable_model.model.encoders.values()
)
cache_configured = (
cache_config is not None and cache_config.cache_type != CacheType.NONE
)
disable_checkpoints = all_encoders_frozen and cache_configured

if disable_checkpoints:
Expand Down

0 comments on commit 79243e2

Please sign in to comment.