MCPcopy
hub / github.com/oobabooga/textgen / decode

Function decode

modules/text_generation.py:183–189  ·  view source on GitHub ↗
(output_ids, skip_special_tokens=True)

Source from the content-addressed store, hash-verified

181
182
183def decode(output_ids, skip_special_tokens=True):
184 if shared.tokenizer is None:
185 models.load_model_if_idle_unloaded()
186 if shared.tokenizer is None:
187 raise ValueError('No tokenizer is loaded')
188
189 return shared.tokenizer.decode(output_ids, skip_special_tokens=skip_special_tokens)
190
191
192def get_encoded_length(prompt):

Callers 5

completions_commonFunction · 0.90
token_decodeFunction · 0.90
generate_reply_HFFunction · 0.85

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected