{# This file contains global settings used across all production templates. #}

{%- macro init_settings(ns) -%}
    {# Set tokens_mapping to special_tokens_mapping if it exists and is not None, otherwise use empty dict #}
    {%- set tokens_mapping = special_tokens_mapping if special_tokens_mapping is defined and special_tokens_mapping is not none else {} -%}

    {%- set ns.bod = tokens_mapping.get('bod', "<|beginningofdialog|>") -%}
    {%- set ns.bom = tokens_mapping.get('bom', "<|beginningofmessage|>") -%}
    {%- set ns.eom = tokens_mapping.get('eom', "<|endofmessage|>") -%}
    {# Use this to represent explicit whitespace at the beginning or end of `content`.#}
    {%- set ns.space = tokens_mapping.get('space', "<|space|>") -%}
    {# `start_token` ensures we don't add a BOM to the first message after timestamp.#}
    {%- set ns.start_token = tokens_mapping.get('start_token', ns.space) -%}
    {%- set ns.audio_mode_token = tokens_mapping.get('audio_mode_token', audio_mode_token or "<|AudioMode|>") -%}
{%- endmacro -%}