MCPcopy Create free account
hub / github.com/FreedomGu/Diffportrait360 / save

Function save

diffportrait360_release/code/utils/checkpoint.py:53–59  ·  view source on GitHub ↗

save model

(obj, filepath: str, **kwargs)

Source from the content-addressed store, hash-verified

51
52# checkpointer from fex. Save to hdfs
53def save(obj, filepath: str, **kwargs):
54 """ save model """
55 if filepath.startswith("hdfs://"):
56 with hopen(filepath, "wb") as writer:
57 torch.save(obj, writer, **kwargs)
58 else:
59 torch.save(obj, filepath, **kwargs)
60
61
62def save_checkpoint(output_dir: str,

Callers 2

save_checkpointFunction · 0.85
save_checkpoint_emaFunction · 0.85

Calls 2

hopenFunction · 0.90
saveMethod · 0.80

Tested by

no test coverage detected