code: def train_spm(input):
      model_writer = io.BytesIO()
      spm.SentencePieceTrainer.train(
          sentence_iterator=iter(input),
          model_writer=model_writer,
          vocab_size=500,
          model_type="bpe",
          input_sentence_size=-1,
          character_coverage=1.0,
          bos_id=0,
          pad_id=1,
          eos_id=2,
          unk_id=3,
      )
      return model_writer.getvalue()
  
file_path: audio/examples/asr/emformer_rnnt/mustc/train_spm.py
imports: import io
  import logging
  import pathlib
  from argparse import ArgumentParser, RawTextHelpFormatter
  import sentencepiece
label_desc: Use image node_id 3 for calling a global function with example usage: train_spm(input) and returns: model_writer