AIIA / ml-service /model.py
RosiYo's picture
fix[bert]: Typo
2a7bc10
raw
history blame contribute delete
478 Bytes
# model.py
from transformers import AutoModelForSequenceClassification, AutoTokenizer
class Model:
"""A model class to lead the model and tokenizer"""
def __init__(self) -> None:
pass
def load_model():
model = AutoModelForSequenceClassification.from_pretrained('cardiffnlp/twitter-roberta-base-sentiment')
return model
def load_tokenizer():
tokenizer = AutoTokenizer.from_pretrained("cardiffnlp/twitter-roberta-base-sentiment")
return tokenizer