class_docstr: Generates scores (log odds) for the top-k tokens for Causal/Masked LM.
      
class_docstr_tok: ["Generates","scores","(","log","odds",")","for","the","top-k","tokens","for","Causal\/Masked","LM","."]
code: def load(cls, in_file, instantiate=True):
      if instantiate:
          return cls._instantiated_load(in_file)
  
      kwargs = super().load(in_file, instantiate=False)
      with Deserializer(
          in_file,
          "shap.models.TextGeneration",
          min_version=0,
          max_version=0,
      ) as s:
          kwargs["tokenizer"] = s.load("tokenizer")
          kwargs["k"] = s.load("k")
          kwargs["generate_topk_token_ids"] = s.load(
              "generate_topk_token_ids"
          )
          kwargs["batch_size"] = s.load("batch_size")
          kwargs["device"] = s.load("device")
      return kwargs
  
file_path: shap/shap/models/_topk_lm.py
imports: import numpy
  import scipy.special
  from .._serializable import Deserializer, Serializer
  from ..utils import safe_isinstance
  from ..utils.transformers import MODELS_FOR_CAUSAL_LM, getattr_silent
  from ._model import Model
label_desc: Use image node_id 10 for calling the TopKLM obj's underlying member method code with example usage: obj.load(cls, in_file, instantiate) and returns: kwargs, cls