class_docstr: A wrapper class around a (`transformers.PreTrainedModel`) to be compatible with the
  (`~transformers.PreTrained`) class in order to keep some attributes and methods of the
  (`~transformers.PreTrainedModel`) class.
  
  Attributes:
      pretrained_model: (`transformers.PreTrainedModel`)
          The model to be wrapped.
      parent_class: (`transformers.PreTrainedModel`)
          The parent class of the model to be wrapped.
      supported_args: (`list`)
          The list of arguments that are supported by the wrapper class.
class_docstr_tok: ["A","wrapper","class","around","a","(","`","transformers.PreTrainedModel","`",")","to","be","compatible","with","the","(","`","~transformers.PreTrained","`",")","class","in","order","to","keep","some","attributes","and","methods","of","the","(","`","~transformers.PreTrainedModel","`",")","class",".","Attributes",":","pretrained_model",":","(","`","transformers.PreTrainedModel","`",")","The","model","to","be","wrapped",".","parent_class",":","(","`","transformers.PreTrainedModel","`",")","The","parent","class","of","the","model","to","be","wrapped",".","supported_args",":","(","`","list","`",")","The","list","of","arguments","that","are","supported","by","the","wrapper","class","."]
docstr: Computes the reward score for a given input. The method has first to enable the adapter
  and then compute the reward score. After that the model disables the reward modeling
  adapter and enables the default ppo adapter again.
docstr_tok: ["Computes","the","reward","score","for","a","given","input",".","The","method","has","first","to","enable","the","adapter","and","then","compute","the","reward","score",".","After","that","the","model","disables","the","reward","modeling","adapter","and","enables","the","default","ppo","adapter","again","."]
code: def compute_reward_score(
      self, input_ids, attention_mask=None, **kwargs
  ):
      r"""
      Computes the reward score for a given input. The method has first to enable the adapter
      and then compute the reward score. After that the model disables the reward modeling
      adapter and enables the default ppo adapter again.
      """
      if not self.supports_rm_adapter:
          raise ValueError(
              "This model does not support reward modeling adapter."
          )
  
      # enable rm adapter
      self.pretrained_model.set_adapter(self.rm_adapter_name)
      self.pretrained_model.eval()
  
      with torch.no_grad():
          base_model_output = self.pretrained_model(
              input_ids=input_ids,
              attention_mask=attention_mask,
              output_hidden_states=True,
              return_dict=True,
              **kwargs,
          )
  
          last_hidden_states = base_model_output.hidden_states[-1]
          scores = self.score(last_hidden_states)
  
      self.pretrained_model.set_adapter(self.policy_adapter_name)
      self.pretrained_model.eval()
  
      return scores
  
imports: import json
  import logging
  import os
  from copy import deepcopy
  import torch
  import torch.nn
  from accelerate import PartialState
  from huggingface_hub import hf_hub_download
  from huggingface_hub.utils import EntryNotFoundError, HFValidationError, LocalEntryNotFoundError, RepositoryNotFoundError
  from safetensors.torch import load_file
  from transformers import PreTrainedModel
  from ..import_utils import is_npu_available, is_peft_available, is_transformers_greater_than, is_xpu_available
label_desc: Use image node_id 11 for calling the PreTrainedModelWrapper obj's underlying member method code with example usage: obj.compute_reward_score(input_ids, attention_mask) and returns: scores