code: def merge_bpe(input_fname: str, output_fname: str):
      
      with utils.smart_open(input_fname, "r") as inp, open(output_fname, "w", encoding="utf-8") as out:
          for line in inp:
              # Merge on special markers and strip stray markers (end of line)
              merged = line.replace(SUBWORD_SPECIAL + " ", "").replace(SUBWORD_SPECIAL, "")
              out.write(merged)
docs: Merge byte-pair encoded sub-words.
  
      :param input_fname: Path of byte-pair encoded input file, plain text or
                          gzipped.
      :param output_fname: Path of tokenized output file, plain text.