Skip to content
Snippets Groups Projects
Commit 234f9b61 authored by Maja Jablonska's avatar Maja Jablonska
Browse files

Serialization - added model weights

parent baa4b609
1 merge request!46Merge COMBO 3.0 into master
......@@ -500,6 +500,7 @@ class Model(Module, FromParameters):
vocabulary_dir = os.path.join(self.serialization_dir, 'vocabulary')
self.vocab._serialization_dir = vocabulary_dir
weights_path = os.path.join(self.serialization_dir, 'weights.pth')
torch.save(self.state_dict(), weights_path)
serialized_model = super().serialize()
serialized_model['weights'] = weights_path
return serialized_model
......
This diff is collapsed.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment