"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "e0b6247cf749c5a6c7b9543f6c16935b58370ce0"
Unverified Commit 8332327d authored by Rahul Nadkarni's avatar Rahul Nadkarni Committed by GitHub
Browse files

Fix sentinel token IDs in data collator for Flax T5 pretraining script (#14477)

parent 2bd950ca
...@@ -291,7 +291,7 @@ class FlaxDataCollatorForT5MLM: ...@@ -291,7 +291,7 @@ class FlaxDataCollatorForT5MLM:
start_indices[:, 0] = mask_indices[:, 0] start_indices[:, 0] = mask_indices[:, 0]
sentinel_ids = np.where(start_indices != 0, np.cumsum(start_indices, axis=-1), start_indices) sentinel_ids = np.where(start_indices != 0, np.cumsum(start_indices, axis=-1), start_indices)
sentinel_ids = np.where(sentinel_ids != 0, (sentinel_ids + self.tokenizer.vocab_size - 1), 0) sentinel_ids = np.where(sentinel_ids != 0, (len(self.tokenizer) - sentinel_ids), 0)
sentinel_ids -= mask_indices - start_indices sentinel_ids -= mask_indices - start_indices
return sentinel_ids return sentinel_ids
......
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