MCPcopy Create free account
hub / github.com/THUDM/GLM / pad_choice_dim

Function pad_choice_dim

tasks/data_utils.py:314–317  ·  view source on GitHub ↗
(data, choice_num)

Source from the content-addressed store, hash-verified

312 text_list = [sample['text'] for sample in batch]
313
314 def pad_choice_dim(data, choice_num):
315 if len(data) < choice_num:
316 data = np.concatenate([data] + [data[0:1]] * (choice_num - len(data)))
317 return data
318
319 if len(text_list[0].shape) == 2:
320 choice_nums = list(map(len, text_list))

Callers 1

my_collateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected