<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def merge_bpe(input_fname: str, output_fname: str):
 """ 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. """

    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)