code: def battle(
      answer1: List[Dict],
      answer2: List[Dict],
      prompt_dict: Dict[str, Any],
  ) -> List[Dict]:
      """
      Use GPT-4 to compare answers of two different models.
  
      Args:
          answer1: answers of model 1.
          answer2: answers of model 2.
          prompt_dict: prompt for battle.
  
      Returns:
          Evaluations of all comparison pairs.
      """
  
      assert len(answer1) == len(answer2)
  
      total_len = len(answer1)
      question_idx_list = list(range(total_len))
  
      print(f" Total number of answers: {len(answer1)}.")
  
      evaluations = []
      with concurrent.futures.ThreadPoolExecutor(
          max_workers=4
      ) as executor:
          futures = []
          for i in question_idx_list:
              assert answer1[i]["id"] == answer2[i]["id"]
              answer_id = answer1[i]["id"]
  
              ques = (
                  answer1[i]["instruction"]
                  if answer1[i]["input"] == ""
                  else answer1[i]["instruction"]
                  + " "
                  + answer1[i]["input"]
              )
              answer1[i]["category"]
              ans1 = answer1[i]["output"]
              ans2 = answer2[i]["output"]
  
              sys_prompt = prompt_dict["system_prompt"]
              prompt_template = prompt_dict["prompt_template"]
              prompt = prompt_template.format(
                  question=ques,
                  answer_1=ans1,
                  answer_2=ans2,
                  prompt=prompt_dict["prompt"],
              )
  
              future = executor.submit(
                  get_battle_result, sys_prompt, prompt, answer_id, 2048
              )
              futures.append(future)
  
          for future in tqdm.tqdm(
              concurrent.futures.as_completed(futures),
              total=len(futures),
          ):
              evaluations.append(future.result())
  
      evaluations.sort(key=lambda x: x["id"])
  
      return evaluations
  
imports: import concurrent.futures
  import os
  import re
  import time
  from copy import deepcopy
  from typing import Any, Dict, List
  import matplotlib.pyplot
  import numpy
  import openai
  import pandas
  import seaborn
  import tqdm
  from colossal_eval.utils import jdump, jload
label_desc: Use image node_id 3 for calling a global function with example usage: battle(answer1, answer2, prompt_dict) and returns: evaluations