MCPcopy Index your code
hub / github.com/THUDM/GLM / append

Method append

data_utils/tokenization.py:113–124  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

111 self.tokenization = self.tokenization[:idx] + other.tokenization + self.tokenization[idx:]
112
113 def append(self, other):
114 if isinstance(other, (CommandToken, TypeToken)):
115 self.tokenization.append(other.Id)
116 self.text += other.token
117 self.original_text += other.token
118 elif isinstance(other, Tokenization):
119 self.tokenization.extend(other.tokenization)
120 self.text += other.text
121 self.original_text += other.original_text
122 else:
123 self.tokenization.append(other)
124 return self
125
126 def extend(self, other):
127 if isinstance(other, (CommandToken, TypeToken)):

Callers 15

sample_spansMethod · 0.80
make_block_dataMethod · 0.80
split_samplesMethod · 0.80
construct_blocksMethod · 0.80
process_batchFunction · 0.80
debug_finetune_dataFunction · 0.80
print_masked_textFunction · 0.80
finalizeMethod · 0.80
addMethod · 0.80
process_grid.pyFile · 0.80
build_multi_task_datasetFunction · 0.80

Calls 1

extendMethod · 0.80

Tested by 1

mainFunction · 0.64