code: def build_tokenizer(
      bpe_path: Optional[str] = DEFAULT_BPE_PATH,
      truncate: Optional[bool] = False,
      bpe_url: str = DEFAULT_BPE_URL,
      download_dir: str = download.DEFAULT_DOWNLOAD_DIR,
  ) -> Callable[[Union[str, Sequence[str]]], np.ndarray]:
      """Returns CLIP's tokenization function."""
      if bpe_path is None:
          bpe_path = download.download(bpe_url, download_dir)
          logging.info(
              "Downloaded vocabulary from %s to %s",
              bpe_url,
              download_dir,
          )
  
      tokenizer = SimpleTokenizer(bpe_path)
      tokenizer_fn = functools.partial(
          _tokenize,
          tokenizer=tokenizer,
          context_length=MAX_TEXT_LENGTH,
          truncate=truncate,
      )
      return tokenizer_fn
  
file_path: scenic/scenic/projects/baselines/clip/tokenizer.py
imports: from absl import logging
  import functools
  from typing import Any, Callable, Optional, Sequence, Union
  from clip.simple_tokenizer import SimpleTokenizer
  import jax.numpy
  import numpy
  from scenic.projects.baselines.clip import download
label_desc: Use image node_id 2 for calling a global function with example usage: build_tokenizer(bpe_path, truncate, bpe_url, download_dir) and returns: tokenizer_fn