Skip to content

Commit

Permalink
fix stopping_criteria check in coca_model
Browse files Browse the repository at this point in the history
  • Loading branch information
MengqingCao committed Apr 12, 2024
1 parent 9eaf242 commit b3b5fea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/open_clip/coca_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def generate(

cur_len += 1

if stopping_criteria(out, None):
if stopping_criteria(out, None).any():
break

if num_dims == 1:
Expand Down Expand Up @@ -439,7 +439,7 @@ def _generate_beamsearch(

# increase cur_len
cur_len = cur_len + 1
if beam_scorer.is_done or stopping_criteria(input_ids, None):
if beam_scorer.is_done or stopping_criteria(input_ids, None).any():
break

final_beam_indices = sum(beam_indices, ()) if beam_indices is not None else None
Expand Down

0 comments on commit b3b5fea

Please sign in to comment.