code: def load_clap_state_dict(clap_model, path: tp.Union[str, Path]):
      """Wrapper around state dict loading of CLAP model
      addressing compatibility issues between CLAP and AudioCraft
      HuggingFace transformer version.
      See: https://github.com/LAION-AI/CLAP/issues/118
      """
      from clap_module.factory import load_state_dict  # type: ignore
  
      pkg = load_state_dict(path)
      pkg.pop("text_branch.embeddings.position_ids", None)
      clap_model.model.load_state_dict(pkg)
  
imports: from concurrent.futures import ProcessPoolExecutor
  from contextlib import contextmanager
  from functools import wraps, lru_cache
  import hashlib
  import json
  import logging
  from pathlib import Path
  import typing
  import flashy
  import flashy.distrib
  import omegaconf
  import torch
  from torch.nn.utils.rnn import pad_sequence
label_desc: Use image node_id 18 for calling a global function with example usage: load_clap_state_dict(clap_model, path) without return types