code: def hf_autotokenizer_to_chat_formatter(
      pretrained_model_name_or_path: Union[str, os.PathLike[str]]
  ) -> ChatFormatter:
      # https://huggingface.co/docs/transformers/main/chat_templating
      # https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1#instruction-format
      # https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1/blob/main/tokenizer_config.json
      from transformers import AutoTokenizer
  
      tokenizer = AutoTokenizer.from_pretrained(
          pretrained_model_name_or_path
      )
  
      def format_autotokenizer(
          messages: List[llama_types.ChatCompletionRequestMessage],
          **kwargs: Any,
      ) -> ChatFormatterResponse:
          tokenizer.use_default_system_prompt = False
          _prompt = tokenizer.apply_chat_template(
              messages, tokenize=False
          )
          # Return formatted prompt and eos token by default
          return ChatFormatterResponse(
              prompt=_prompt, stop=tokenizer.eos_token
          )
  
      return format_autotokenizer
  
imports: from __future__ import annotations
  import os
  import json
  import ctypes
  import dataclasses
  from typing import Any, Dict, Iterator, List, Optional, Tuple, Union, Protocol
  import llama_cpp.llama
  import llama_cpp.llama_types
  import llama_cpp.llama_grammar
  from ._utils import suppress_stdout_stderr
label_desc: Use image node_id 17 for calling a global function with example usage: hf_autotokenizer_to_chat_formatter(pretrained_model_name_or_path) and returns: format_autotokenizer, ChatFormatterResponse