code: def tokenize_csv(
      fname,
      text_cols,
      outname=None,
      n_workers=4,
      rules=None,
      mark_fields=None,
      tok=None,
      header="infer",
      chunksize=50000,
  ):
      "Tokenize texts in the `text_cols` of the csv `fname` in parallel using `n_workers`"
      df = pd.read_csv(fname, header=header, chunksize=chunksize)
      outname = Path(
          ifnone(outname, fname.parent / f"{fname.stem}_tok.csv")
      )
      cnt = Counter()
  
      for i, dfp in enumerate(df):
          out, c = tokenize_df(
              dfp,
              text_cols,
              n_workers=n_workers,
              rules=rules,
              mark_fields=mark_fields,
              tok=tok,
          )
          out.text = out.text.str.join(" ")
          out.to_csv(
              outname,
              header=(None, header)[i == 0],
              index=False,
              mode=("a", "w")[i == 0],
          )
          cnt.update(c)
  
      save_pickle(outname.with_suffix(".pkl"), cnt)
  
imports: from __future__ import annotations
  from ..torch_basics import *
  from ..data.all import *
  import html
label_desc: Use image node_id 18 for calling a global function with example usage: tokenize_csv(fname, text_cols, outname, n_workers, rules, mark_fields, tok, header, chunksize) without return types