MCPcopy Create free account
hub / github.com/Pints-AI/1.5-Pints / save

Method save

lit_gpt/utils.py:243–252  ·  view source on GitHub ↗
(self, obj)

Source from the content-addressed store, hash-verified

241 raise TypeError(f'can only store tensors early, not {type(tensor)}')
242
243 def save(self, obj):
244 if self.has_saved:
245 raise RuntimeError('have already saved')
246 # Write the pickle data for `obj`
247 data_buf = BytesIO()
248 pickler = IncrementalPyTorchPickler(self, data_buf, protocol=5)
249 pickler.dump(obj)
250 data_value = data_buf.getvalue()
251 self.zipfile.write_record('data.pkl', data_value, len(data_value))
252 self.has_saved = True
253
254 def _write_storage_and_return_key(self, storage):
255 if self.has_saved:

Callers 7

convert_lit_checkpointFunction · 0.45
convert_hf_checkpointFunction · 0.45
save_hyperparametersFunction · 0.45
mainFunction · 0.45
fitFunction · 0.45
save_checkpointFunction · 0.45

Calls 1

Tested by

no test coverage detected