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

Method get_token_len

opencompass/models/base.py:139–147  ·  view source on GitHub ↗

Get lengths of the tokenized strings. Args: prompt (str): Input string. Returns: int: Length of the input tokens

(self, prompt: str)

Source from the content-addressed store, hash-verified

137
138 @abstractmethod
139 def get_token_len(self, prompt: str) -> int:
140 """Get lengths of the tokenized strings.
141
142 Args:
143 prompt (str): Input string.
144
145 Returns:
146 int: Length of the input tokens
147 """
148
149 def parse_template(self, prompt_template: PromptType, mode: str) -> str:
150 """Parse a prompt template, and wrap it with meta template if

Callers 2

sync_inputsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected