code: def add_to_gguf(self, gw: GGUFWriter, quiet: bool = False) -> None:
      if self.merges:
          if not quiet:
              print(f"gguf: Adding {len(self.merges)} merge(s).")
          gw.add_token_merges(self.merges)
      elif self.load_merges:
          print(
              "gguf: WARNING: Adding merges requested but no merges found, output may be non-functional.",
              file=sys.stderr,
          )
      for typ, tokid in self.special_token_ids.items():
          id_handler: Callable[[int], None] | None = getattr(
              gw, f"add_{typ}_token_id", None
          )
          if id_handler is None:
              print(
                  f"gguf: WARNING: No handler for special token type {typ} with id {tokid} - skipping",
                  file=sys.stderr,
              )
              continue
          if not quiet:
              print(
                  f"gguf: Setting special token type {typ} to {tokid}"
              )
          id_handler(tokid)
      for typ, value in self.add_special_token.items():
          add_handler: Callable[[bool], None] | None = getattr(
              gw, f"add_add_{typ}_token", None
          )
          if add_handler is None:
              print(
                  f"gguf: WARNING: No handler for add_{typ}_token with value {value} - skipping",
                  file=sys.stderr,
              )
              continue
          if not quiet:
              print(f"gguf: Setting add_{typ}_token to {value}")
          add_handler(value)
      if self.chat_template is not None:
          if not quiet:
              print(
                  f"gguf: Setting chat_template to {self.chat_template}"
              )
          gw.add_chat_template(self.chat_template)
  
file_path: llama.cpp/gguf-py/gguf/vocab.py
imports: from __future__ import annotations
  import json
  import os
  import sys
  from pathlib import Path
  from typing import Any, Callable
  from .gguf_writer import GGUFWriter
label_desc: Use image node_id 3 for calling the SpecialVocab obj's underlying member method code with example usage: obj.add_to_gguf(gw, quiet) without return types