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

Method write

data_utils/lazy_loader.py:79–89  ·  view source on GitHub ↗
(self, s)

Source from the content-addressed store, hash-verified

77 return os.path.join(lazypath, data_type + '.len.pkl')
78
79 def write(self, s):
80 if isinstance(s, dict):
81 s = s['text']
82 if self.is_array:
83 encoded = np.array(s, dtype=self.array_data_type).tobytes(order='C')
84 self.output.write(encoded)
85 self.lengths.append(len(s))
86 else:
87 encoded = s.encode('utf-8')
88 self.output.write(encoded)
89 self.lengths.append(len(encoded))
90
91 def close(self):
92 self.output.close()

Callers 1

get_datasetFunction · 0.95

Calls 2

appendMethod · 0.80
encodeMethod · 0.45

Tested by

no test coverage detected