Adapters
English
code
medical
dnnsdunca commited on
Commit
455a50b
1 Parent(s): 5412105

Create Helper_functions.py

Browse files
Files changed (1) hide show
  1. Helper_functions.py +10 -0
Helper_functions.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ # utils/helper_functions.py
2
+ import torch
3
+
4
+ def save_model(model, path):
5
+ torch.save(model.state_dict(), path)
6
+
7
+ def load_model(model, path):
8
+ model.load_state_dict(torch.load(path))
9
+ model.eval()
10
+ return model