class_docstr: Will act like a Turker but actually contains a bot agent.
docstr: Return shared bot agents.
  
  Pass in model opts with the `model_opts` arg, where `model_opts` is a dictionary
  whose keys are model names and whose values are strings that specify model
  params (i.e. `--model image_seq2seq`).
docstr_tok: ["Return","shared","bot","agents",".","Pass","in","model","opts","with","the","`","model_opts","`","arg",",","where","`","model_opts","`","is","a","dictionary","whose","keys","are","model","names","and","whose","values","are","strings","that","specify","model","params","(","i.e",".","`","--","model","image_seq2seq","`",")","."]
code: def get_bot_agents(
      args: DictConfig, model_opts: Dict[str, str], no_cuda=False
  ) -> Dict[str, dict]:
      """
      Return shared bot agents.
  
      Pass in model opts with the `model_opts` arg, where `model_opts` is a dictionary
      whose keys are model names and whose values are strings that specify model
      params (i.e. `--model image_seq2seq`).
      """
  
      # Set up overrides
      model_overrides = {
          "model_parallel": args.blueprint.task_model_parallel
      }
      if no_cuda:
          # If we load many models at once, we have to keep it on CPU
          model_overrides["no_cuda"] = no_cuda
      else:
          logging.warning(
              "WARNING: MTurk task has no_cuda FALSE. Models will run on GPU. Will "
              "not work if loading many models at once."
          )
  
      # Convert opt strings to Opt objects
      processed_opts = {}
      for name, opt_string in model_opts.items():
          parser = ParlaiParser(True, True)
          parser.set_params(**model_overrides)
          processed_opts[name] = parser.parse_args(opt_string.split())
  
      # Load and share all model agents
      logging.info(
          f"Got {len(list(processed_opts.keys()))} models: {processed_opts.keys()}."
      )
      shared_bot_agents = {}
      for model_name, model_opt in processed_opts.items():
          logging.info("\n\n--------------------------------")
          logging.info(
              f"model_name: {model_name}, opt_dict: {model_opt}"
          )
          model_agent = create_agent(model_opt, requireModelExists=True)
          shared_bot_agents[model_name] = model_agent.share()
      return shared_bot_agents
  
file_path: ParlAI/parlai/crowdsourcing/tasks/model_chat/bot_agent.py
imports: import copy
  from typing import Dict
  from omegaconf import DictConfig
  import parlai.utils.logging
  from parlai.core.agents import create_agent
  from parlai.core.message import Message
  from parlai.core.params import ParlaiParser
  from parlai.crowdsourcing.tasks.model_chat.constants import AGENT_1
  from parlai.utils.strings import normalize_reply
label_desc: Use image node_id 6 for calling the TurkLikeAgent obj's underlying member method code with example usage: obj.get_bot_agents(args, model_opts, no_cuda) and returns: shared_bot_agents