From 01efe132afe5143c7e232894c3540ead0863ac12 Mon Sep 17 00:00:00 2001 From: Praveen Selvaraj Date: Mon, 13 Feb 2023 12:18:59 +0000 Subject: [PATCH] readme addition: saving and loading models from disk --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index b2fe2a9c..2d7fc70f 100644 --- a/README.md +++ b/README.md @@ -190,6 +190,20 @@ reloaded = load(buff) assert syn_model.name() == reloaded.name() ``` +* Saving and loading models from disk + +```python +from synthcity.utils.serialization import save_to_file, load_from_file +from synthcity.plugins import Plugins + +syn_model = Plugins().get("adsgan") + +save_to_file('./adsgan_10_epochs.pkl', syn_model) +reloaded = load_from_file('./adsgan_10_epochs.pkl') + +assert syn_model.name() == reloaded.name() +``` + * Using the Serializable interface ```python