MCPcopy Index your code
hub / github.com/zai-org/CodeGeeX / decode_code

Method decode_code

codegeex/mindspore/src/code_tokenizer.py:161–171  ·  view source on GitHub ↗
(self, input_ids)

Source from the content-addressed store, hash-verified

159 return input_ids
160
161 def decode_code(self, input_ids):
162 if self.mode == '6b':
163 texts = self.tokenizer.batch_decode(input_ids)
164 output_code = [decode_whitespaces(text, self.start_extra_id, self.max_len) for text in texts]
165
166 elif self.mode == '13b':
167 input_ids = [self.code_dict.decode_tokens(input_ids.tolist()[0])]
168 texts = self.tokenizer.batch_decode(input_ids)
169 output_code = [decode_whitespaces(text, self.start_extra_id, self.max_len) for text in texts]
170
171 return output_code

Callers 7

run_predictFunction · 0.95
run_predictFunction · 0.95
run_predictFunction · 0.95
run_predictFunction · 0.95
generate_incrementFunction · 0.45
generate_incrementFunction · 0.45
generate_incrementFunction · 0.45

Calls 2

decode_tokensMethod · 0.80
decode_whitespacesFunction · 0.70

Tested by

no test coverage detected