code: def format_prompt(input_str, chat_history):
      prompt = [f"{SYSTEM_PROMPT}\n"]
      for history_input_str, history_output_str in chat_history:
          prompt.append(
              f"{HUMAN_ID} {history_input_str}\n{BOT_ID} {history_output_str}\n"
          )
      prompt.append(f"{HUMAN_ID} {input_str}\n{BOT_ID} ")
      return "".join(prompt)
  
file_path: BigDL/docker/llm/inference/xpu/docker/chat.py
imports: import intel_extension_for_pytorch
  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
label_desc: Use image node_id 1 for calling a global function with example usage: format_prompt(input_str, chat_history) and returns: str