Skip to content

Commit

Permalink
fix ruff tenary error
Browse files Browse the repository at this point in the history
  • Loading branch information
helpmefindaname committed Oct 14, 2023
1 parent ae5ca66 commit 04856ef
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions flair/models/sequence_tagger_utils/viterbi.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,7 @@ def _all_scores_for_token(
scores = scores.numpy()
for i_batch, batch in enumerate(scores):
for i, (tag_id, tag_scores) in enumerate(zip(tag_seq, batch)):
if isinstance(tag_id, int):
tag_id_int = tag_id
else:
tag_id_int = int(tag_id.item())
tag_id_int = tag_id if isinstance(tag_id, int) else int(tag_id.item())

if tag_id_int != np.argmax(tag_scores):
swap_index_score = int(np.argmax(tag_scores))
Expand Down

0 comments on commit 04856ef

Please sign in to comment.