code: def concat_generator(filename, up_threshold, low_threshold=10):
    
    txt = ""
    for line in tf.gfile.Open(filename):
      line = line.strip()
      if len(txt) + len(line) + 1 >= up_threshold:
        ret = txt
        txt = ""
        # We don't yield very short long parts to prevent noisy examples.
        if len(ret) > low_threshold and len(ret) < up_threshold:
          yield {"targets": ret}
  
      if not txt:
        txt = line
      else:
        txt = " ".join([txt, line])
docs: Generate concatenated lines from file upto up_threshold characters.