MCPcopy Create free account
hub / github.com/modelscope/FunASR / ids2tokens

Method ids2tokens

funasr/tokenizer/abs_tokenizer.py:108–116  ·  view source on GitHub ↗

Ids2tokens. Args: integers: TODO.

(self, integers: Union[np.ndarray, Iterable[int]])

Source from the content-addressed store, hash-verified

106 return len(self.token_list)
107
108 def ids2tokens(self, integers: Union[np.ndarray, Iterable[int]]) -> List[str]:
109 """Ids2tokens.
110
111 Args:
112 integers: TODO.
113 """
114 if isinstance(integers, np.ndarray) and integers.ndim != 1:
115 raise ValueError(f"Must be 1 dim ndarray, but got {integers.ndim}")
116 return [self.token_list[i] for i in integers]
117
118 def tokens2ids(self, tokens: Iterable[str]) -> List[int]:
119 """Tokens2ids.

Callers 15

decodeMethod · 0.95
inferenceMethod · 0.45
inferenceMethod · 0.45
inferenceMethod · 0.45
inferenceMethod · 0.45
inferenceMethod · 0.45
inferenceMethod · 0.45
inferenceMethod · 0.45
inferenceMethod · 0.45
generate_chunkMethod · 0.45
inferenceMethod · 0.45
inferenceMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected