"megatron/legacy/vscode:/vscode.git/clone" did not exist on "0fc0844fbe63768410b81bfa5b3dc3c99f5e8d96"
Unverified Commit 45a14754 authored by Matt's avatar Matt Committed by GitHub
Browse files

Fix TF bad words filter with XLA (#18286)

* Fix bad words filter in XLA generation

* Remove my cool debug breakpoints (again)
parent f4e17271
......@@ -332,7 +332,7 @@ class TFNoBadWordsLogitsProcessor(TFLogitsProcessor):
def _len_greater_than_cur_len():
# Otherwise, if the bad sequence is longer than the current length they can't ever match
return tf.cond(
tf.math.greater(self.bad_word_seqs_len[bad_word_seq_number], row_input_ids.shape[0]),
tf.math.greater(self.bad_word_seqs_len[bad_word_seq_number], tf.shape(row_input_ids)[0]),
lambda: tf.zeros((), dtype=tf.bool),
_match_found,
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment