code: def make_bot_message(prompt, inference_mode):
      src = [prompt.replace("\n", "｟newline｠")]
      if inference_mode == "py":
          scores, predictions = CACHE["inference_engine"].infer_list(
              src
          )
          # The hypotheses are lists of one element but we still need to take the first one.
          bot_message = "\n".join(sent[0] for sent in predictions)
      elif inference_mode == "ct2":
          scores, predictions = CACHE["inference_engine"].infer_list(
              src
          )
          bot_message = "\n".join(sent[0] for sent in predictions)
      bot_message = bot_message.replace("｟newline｠", "\n")
      return bot_message
  
file_path: OpenNMT-py/docs/source/examples/replicate_vicuna/chatbot.py
imports: import argparse
  import gradio
  import numpy
  import time
  import onmt.opts
  from onmt.transforms.tokenize import SentencePieceTransform
  from onmt.utils.parse import ArgumentParser
  from onmt.utils.misc import use_gpu, set_random_seed
label_desc: Use image node_id 5 for calling a global function with example usage: make_bot_message(prompt, inference_mode) and returns: bot_message