Spaces:
Sleeping
Sleeping
Create load_model.py
Browse files- 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
|