black formatting round 2

This commit is contained in:
thomashacker 2023-03-31 12:08:08 +02:00
parent 34d3720fc0
commit 2b19b35030
2 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@ from typing import Union, Iterable, Sequence, TypeVar, List, Callable, Iterator
from typing import Optional, Any from typing import Optional, Any
from functools import partial from functools import partial
import itertools import itertools
from thinc.schedules import Schedule #type:ignore[attr-defined] from thinc.schedules import Schedule # type:ignore[attr-defined]
from ..util import registry, minibatch from ..util import registry, minibatch
@ -221,7 +221,7 @@ def _batch_by_length(
if not batch: if not batch:
batch.append(i) batch.append(i)
elif length * (len(batch) + 1) <= max_words: elif length * (len(batch) + 1) <= max_words:
batch.append(i) batch.append(i)
else: else:
batches.append(batch) batches.append(batch)
batch = [i] batch = [i]

View File

@ -241,7 +241,7 @@ def train_while_improving(
score, other_scores = evaluate() score, other_scores = evaluate()
else: else:
score, other_scores = evaluate() score, other_scores = evaluate()
optimizer.last_score = score #type:ignore[attr-defined] optimizer.last_score = score # type:ignore[attr-defined]
results.append((score, step)) results.append((score, step))
is_best_checkpoint = score == max(results)[0] is_best_checkpoint = score == max(results)[0]
else: else: