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 save(self, out_file):
      super().save(out_file)
  
      # Increment the version number when the encoding changes!
      with Serializer(
          out_file, "shap.models.TextGeneration", version=0
      ) as s:
          s.save("tokenizer", self.tokenizer)
          s.save("k", self.k)
          s.save(
              "generate_topk_token_ids",
              self._custom_generate_topk_token_ids,
          )
          s.save("batch_size", self.batch_size)
          s.save("device", self.device)
  
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 9 for calling the TopKLM obj's underlying member method code with example usage: obj.save(out_file) without return types