Erfan11 commited on
Commit
0e7cada
1 Parent(s): 5e75eb5

Create load_model.py

Browse files
Files changed (1) hide show
  1. load_model.py +7 -0
load_model.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from transformers import AutoModelForSequenceClassification
3
+
4
+ def load_model(model_path):
5
+ model = AutoModelForSequenceClassification.from_pretrained(model_path)
6
+ model.eval()
7
+ return model