MCPcopy Create free account
hub / github.com/InternScience/SciReason / decode

Method decode

opencompass/models/base.py:125–136  ·  view source on GitHub ↗

Decode tokens to text. Not necessary for most cases. Args: tokens (torch.Tensor): Input tokens. Returns: str: Decoded text.

(self, tokens: torch.Tensor)

Source from the content-addressed store, hash-verified

123
124 @abstractmethod
125 def decode(self, tokens: torch.Tensor) -> str:
126 """Decode tokens to text. Not necessary for most cases.
127
128 Args:
129 tokens (torch.Tensor): Input tokens.
130
131 Returns:
132 str: Decoded text.
133 """
134 raise NotImplementedError(
135 f'{self.__class__.__name__} does not implement'
136 '`decode` method.')
137
138 @abstractmethod
139 def get_token_len(self, prompt: str) -> int:

Callers 15

sync_inputsMethod · 0.95
process_hdf5_dictFunction · 0.80
process_hdf5_to_tupleFunction · 0.80
_code_eval_serviceMethod · 0.80
loadMethod · 0.80
postprocessMethod · 0.80
api_scoreMethod · 0.80
run_cmscanMethod · 0.80
_code_eval_serviceMethod · 0.80
_code_eval_serviceMethod · 0.80
_decode_tokensMethod · 0.80
_decode_tokensMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected