code: def get_stopping_criteria(conv, tokenizer, input_ids):
      stop_str = (
          conv.sep
          if conv.sep_style != SeparatorStyle.TWO
          else conv.sep2
      )
      keywords = [stop_str]
      stopping_criteria = KeywordsStoppingCriteria(
          keywords, tokenizer, input_ids
      )
      return stopping_criteria
  
file_path: BigDL/python/llm/example/GPU/PyTorch-Models/Model/llava/generate.py
imports: import argparse
  import torch
  import time
  from transformers import AutoModelForCausalLM
  from llava.model.language_model.llava_llama import LlavaLlamaForCausalLM
  from transformers import AutoTokenizer
  from llava.constants import DEFAULT_IMAGE_PATCH_TOKEN, IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN
  from llava.conversation import conv_templates, SeparatorStyle
  from llava.utils import disable_torch_init
  from llava.mm_utils import process_images, tokenizer_image_token, get_model_name_from_path, KeywordsStoppingCriteria
  from bigdl.llm import optimize_model
label_desc: Use image node_id 6 for calling a global function with example usage: get_stopping_criteria(conv, tokenizer, input_ids) and returns: stopping_criteria