NLP / downloadModel.py
ashishraics's picture
download script for models
9742e85
raw
history blame
618 Bytes
from transformers import AutoModelForSequenceClassification,AutoTokenizer
#***********************************************************************************************************
###FOR SENTIMENT CLASSIFICATION
chkpt='distilbert-base-uncased-finetuned-sst-2-english'
model=AutoModelForSequenceClassification.from_pretrained(chkpt)
tokenizer=AutoTokenizer.from_pretrained(chkpt)
#save the pertrained model
model.save_pretrained('sentiment_classifier/')
tokenizer.save_pretrained('sentiment_classifier/')
#***********************************************************************************************************