code: def data_clean(
      dataset_file,
      output_file,
      seq_len=4096,
      library="huggingface",
      model_name="EleutherAI/gpt-neox-20b",
      tokenizer_model=None,
  ):
      tokenizer = get_nmt_tokenizer(
          library=library,
          model_name=model_name,
          tokenizer_model=tokenizer_model,
          use_fast=True,
      )
      if library == "huggingface":
          tokenizer.add_special_tokens(
              {
                  "additional_special_tokens": [
                      "<extra_id_0>",
                      "<extra_id_1>",
                      "<extra_id_2>",
                  ]
              }
          )
      d = GPTSFTChatDataset(
          dataset_file, tokenizer, seq_len, 1, hf_dataset=True
      )
      total_records = len(d)
      removed_ids = set()
      for i in range(total_records):
          if i % 1000 == 0:
              print(i)
          try:
              if d[i]["mask"][: seq_len + 1].sum().item() == 0:
                  removed_ids.add(i)
                  print(f"removed {i}")
                  continue
          except:
              removed_ids.add(i)
              print(f"Exception removed {i}")
      with open(dataset_file, "r", encoding="utf-8") as f:
          with open(output_file, "w", encoding="utf-8") as o:
              for i, line in enumerate(f):
                  if i in removed_ids:
                      continue
                  obj = json.loads(line)
                  o.write(json.dumps(obj, ensure_ascii=False) + "\n")
  
imports: import argparse
  import json
  from nemo.collections.nlp.data.language_modeling.megatron.gpt_sft_chat_dataset import GPTSFTChatDataset
  from nemo.collections.nlp.modules.common.tokenizer_utils import get_nmt_tokenizer
label_desc: Use image node_id 1 for calling a global function with example usage: data_clean(dataset_file, output_file, seq_len, library, model_name, tokenizer_model) without return types