code: def get_stop_words_ids(chat_format, tokenizer):
      # https://github.com/QwenLM/Qwen/blob/main/examples/vllm_wrapper.py#L23
      if chat_format == "Qwen":
          stop_words_ids = [
              [tokenizer.im_end_id],
              [tokenizer.im_start_id],
              [tokenizer.eod_id],
          ]
      # https://huggingface.co/01-ai/Yi-6B-Chat/blob/main/tokenizer_config.json#L38
      elif chat_format == "Yi":
          stop_words_ids = [tokenizer.encode("<|im_end|>")]
      else:
          raise NotImplementedError(
              f"Unknown chat format {chat_format!r}"
          )
      return stop_words_ids
  
file_path: BigDL/python/llm/portable-zip/chat.py
imports: import torch
  import argparse
  import sys
  from transformers import AutoModel, AutoModelForCausalLM, AutoTokenizer, AutoConfig
  from transformers import TextIteratorStreamer
  from transformers.tools.agents import StopSequenceCriteria
  from transformers.generation.stopping_criteria import StoppingCriteriaList
  from colorama import Fore
  from bigdl.llm import optimize_model
  from kv_cache import StartRecentKVCache
label_desc: Use image node_id 1 for calling a global function with example usage: get_stop_words_ids(chat_format, tokenizer) and returns: stop_words_ids