class_docstr: Constructs a Bark processor which wraps a text tokenizer and optional Bark voice presets into a single processor.
  
  Args:
      tokenizer ([`PreTrainedTokenizer`]):
          An instance of [`PreTrainedTokenizer`].
      speaker_embeddings (`Dict[Dict[str]]`, *optional*):
          Optional nested speaker embeddings dictionary. The first level contains voice preset names (e.g
          `"en_speaker_4"`). The second level contains `"semantic_prompt"`, `"coarse_prompt"` and `"fine_prompt"`
          embeddings. The values correspond to the path of the corresponding `np.ndarray`. See
          [here](https://suno-ai.notion.site/8b8e8749ed514b0cbf3f699013548683?v=bc67cff786b04b50b3ceb756fd05f68c) for
          a list of `voice_preset_names`.
class_docstr_tok: ["Constructs","a","Bark","processor","which","wraps","a","text","tokenizer","and","optional","Bark","voice","presets","into","a","single","processor",".","Args",":","tokenizer","(","[","`","PreTrainedTokenizer","`","]",")",":","An","instance","of","[","`","PreTrainedTokenizer","`","]",".","speaker_embeddings","(","`","Dict","[","Dict","[","str","]","]","`",",","*","optional","*",")",":","Optional","nested","speaker","embeddings","dictionary",".","The","first","level","contains","voice","preset","names","(","e.g","`","``","en_speaker_4","''","`",")",".","The","second","level","contains","`","``","semantic_prompt","''","`",",","`","``","coarse_prompt","''","`","and","`","``","fine_prompt","''","`","embeddings",".","The","values","correspond","to","the","path","of","the","corresponding","`","np.ndarray","`",".","See","[","here","]","(","https",":","\/\/suno-ai.notion.site\/8b8e8749ed514b0cbf3f699013548683","?","v=bc67cff786b04b50b3ceb756fd05f68c",")","for","a","list","of","`","voice_preset_names","`","."]
code: def _load_voice_preset(self, voice_preset: str = None, **kwargs):
      voice_preset_paths = self.speaker_embeddings[voice_preset]
  
      voice_preset_dict = {}
      for key in ["semantic_prompt", "coarse_prompt", "fine_prompt"]:
          if key not in voice_preset_paths:
              raise ValueError(
                  f"Voice preset unrecognized, missing {key} as a key in self.speaker_embeddings[{voice_preset}]."
              )
  
          path = get_file_from_repo(
              self.speaker_embeddings.get("repo_or_path", "/"),
              voice_preset_paths[key],
              subfolder=kwargs.pop("subfolder", None),
              cache_dir=kwargs.pop("cache_dir", None),
              force_download=kwargs.pop("force_download", False),
              proxies=kwargs.pop("proxies", None),
              resume_download=kwargs.pop("resume_download", False),
              local_files_only=kwargs.pop("local_files_only", False),
              token=kwargs.pop("use_auth_token", None),
              revision=kwargs.pop("revision", None),
          )
          if path is None:
              raise ValueError(
                  f"""`{os.path.join(self.speaker_embeddings.get("repo_or_path", "/"),voice_preset_paths[key])}` does not exists
                      , no preloaded voice preset will be used - Make sure to provide correct paths to the {voice_preset}
                      embeddings."""
              )
  
          voice_preset_dict[key] = np.load(path)
  
      return voice_preset_dict
  
file_path: transformers/src/transformers/models/bark/processing_bark.py
imports: import json
  import os
  from typing import Optional
  import numpy
  from ...feature_extraction_utils import BatchFeature
  from ...processing_utils import ProcessorMixin
  from ...utils import logging
  from ...utils.hub import get_file_from_repo
  from ..auto import AutoTokenizer
label_desc: Use image node_id 4 for calling the BarkProcessor obj's underlying member method code with example usage: obj._load_voice_preset(voice_preset) and returns: voice_preset_dict