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 committed Jun 1, 2022
1 parent dfa8057 commit b7759a1
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 @@ -158,8 +158,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 b7759a1

Please sign in to comment.