class_docstr: Subclass of BaseModelChatBlueprint to show the speakers an image on the first turn.
  
  The image is drawn from a stack that keeps track of how many HITs have been launched
  for a given combination of image and model.
class_docstr_tok: ["Subclass","of","BaseModelChatBlueprint","to","show","the","speakers","an","image","on","the","first","turn",".","The","image","is","drawn","from","a","stack","that","keeps","track","of","how","many","HITs","have","been","launched","for","a","given","combination","of","image","and","model","."]
code: def __init__(
      self,
      task_run: "TaskRun",
      args: "DictConfig",
      shared_state: "SharedTaskState",
  ):
      super().__init__(
          task_run=task_run, args=args, shared_state=shared_state
      )
  
      with open(args.blueprint.image_context_path, "rb") as f:
          shared_state.image_contexts = pickle.load(f)
  
      # Create the stack to keep track of how many workers have seen which
      # combinations of images and models
      image_opt = {
          "evals_per_image_model_combo": args.blueprint.evals_per_image_model_combo,
          "num_images": len(shared_state.image_contexts),
          "models": list(shared_state.shared_models.keys()),
          "stack_folder": args.blueprint.stack_folder,
      }
      shared_state.image_stack = ImageStack(image_opt)
  
      shared_state.world_opt.update(
          {
              "image_contexts": shared_state.image_contexts,
              "image_stack": shared_state.image_stack,
          }
      )
  
imports: import json
  import os
  import pickle
  import random
  from abc import ABC, abstractmethod
  from dataclasses import dataclass, field
  from threading import Semaphore, Condition
  from typing import Any, Dict, List, Optional, TYPE_CHECKING
  import numpy
  import torch
  import yaml
  from mephisto.operations.registry import register_mephisto_abstraction
  from mephisto.abstractions.blueprint import SharedTaskState
  from mephisto.abstractions.blueprints.parlai_chat.parlai_chat_blueprint import ParlAIChatBlueprint, SharedParlAITaskState, ParlAIChatBlueprintArgs
  from omegaconf import DictConfig, MISSING
  from parlai.crowdsourcing.tasks.model_chat.bot_agent import TurkLikeAgent
  from parlai.crowdsourcing.tasks.model_chat.utils import ImageStack, get_context_generator
  from parlai.tasks.blended_skill_talk.agents import ContextGenerator
label_desc: Use image node_id 2 to create a new ModelImageChatBlueprint object from inherited base classes: BaseModelChatBlueprint with example: obj = ModelImageChatBlueprint(task_run, args, shared_state)