NLP / downloadModel.py
ashishraics's picture
add zeroshot model
d5960c1
raw
history blame
No virus
1.19 kB
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/')
# ##***********************************************************************************************************##
# # ##***********************************************************************************************************##
# # ###FOR Zero Shot Text Classification
# chkpt='valhalla/distilbart-mnli-12-1'
#
# model=AutoModelForSequenceClassification.from_pretrained(chkpt)
# tokenizer=AutoTokenizer.from_pretrained(chkpt)
#
# #save the pertrained model
# model.save_pretrained('zero_shot_clf/')
# tokenizer.save_pretrained('zero_shot_clf/')
# # ##***********************************************************************************************************##