Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 14, 2022
1 parent cb66ffe commit 203c67b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
from tqdm.auto import tqdm

from nemo.collections.nlp.data.language_modeling.megatron.base_prompt_learning_dataset import BasePromptLearningDataset
from nemo.collections.nlp.models.language_modeling.megatron_t5_model import T5Sentinel
from nemo.collections.nlp.modules.common import VirtualPromptSource
from nemo.collections.nlp.modules.common.megatron.utils import build_position_ids
from nemo.collections.nlp.models.language_modeling.megatron_t5_model import T5Sentinel
from nemo.utils import logging

__all__ = ['T5PromptLearningDataset']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,10 @@ def ids_to_text(cls, batch_ids, tokenizer):
idx = ids.index(tokenizer.eos_id)
ids = ids[:idx]

if len(tokenizer.text_to_ids(T5Sentinel.END.value)) == 1 and tokenizer.text_to_ids(T5Sentinel.END.value)[0] in ids:
if (
len(tokenizer.text_to_ids(T5Sentinel.END.value)) == 1
and tokenizer.text_to_ids(T5Sentinel.END.value)[0] in ids
):
idx = ids.index(tokenizer.text_to_ids(T5Sentinel.END.value)[0])
ids = ids[:idx]

Expand Down

0 comments on commit 203c67b

Please sign in to comment.