code: def _load_history_prompt(history_prompt_input):
      if isinstance(
          history_prompt_input, str
      ) and history_prompt_input.endswith(".npz"):
          history_prompt = np.load(history_prompt_input)
      elif isinstance(history_prompt_input, str):
          # make sure this works on non-ubuntu
          history_prompt_input = os.path.join(
              *history_prompt_input.split("/")
          )
          if history_prompt_input not in ALLOWED_PROMPTS:
              raise ValueError("history prompt not found")
          history_prompt = np.load(
              os.path.join(
                  CUR_PATH,
                  "assets",
                  "prompts",
                  f"{history_prompt_input}.npz",
              )
          )
      elif isinstance(history_prompt_input, dict):
          assert "semantic_prompt" in history_prompt_input
          assert "coarse_prompt" in history_prompt_input
          assert "fine_prompt" in history_prompt_input
          history_prompt = history_prompt_input
      else:
          raise ValueError("history prompt format unrecognized")
      return history_prompt
  
imports: import contextlib
  import gc
  import os
  import re
  from encodec import EncodecModel
  import funcy
  import logging
  import numpy
  from scipy.special import softmax
  import torch
  import torch.nn.functional
  import tqdm
  from transformers import BertTokenizer
  from huggingface_hub import hf_hub_download
  from .model import GPTConfig, GPT
  from .model_fine import FineGPT, FineGPTConfig
label_desc: Use image node_id 16 for calling a global function with example usage: _load_history_prompt(history_prompt_input) and returns: history_prompt