Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
Erfan11
/
Textwizai
like
0
Sleeping
App
Files
Files
Community
1
e6085a5
Textwizai
/
load_model.py
Erfan11
Create load_model.py
0e7cada
verified
about 2 months ago
raw
Copy download link
history
blame
Safe
210 Bytes
import
torch
from
transformers
import
AutoModelForSequenceClassification
def
load_model
(
model_path
):
model = AutoModelForSequenceClassification.from_pretrained(model_path)
model.
eval
()
return
model