Spaces:
Runtime error
Runtime error
ashishraics
commited on
Commit
•
9742e85
1
Parent(s):
cd5aa21
download script for models
Browse files- downloadModel.py +13 -0
downloadModel.py
CHANGED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import AutoModelForSequenceClassification,AutoTokenizer
|
2 |
+
|
3 |
+
#***********************************************************************************************************
|
4 |
+
###FOR SENTIMENT CLASSIFICATION
|
5 |
+
chkpt='distilbert-base-uncased-finetuned-sst-2-english'
|
6 |
+
|
7 |
+
model=AutoModelForSequenceClassification.from_pretrained(chkpt)
|
8 |
+
tokenizer=AutoTokenizer.from_pretrained(chkpt)
|
9 |
+
|
10 |
+
#save the pertrained model
|
11 |
+
model.save_pretrained('sentiment_classifier/')
|
12 |
+
tokenizer.save_pretrained('sentiment_classifier/')
|
13 |
+
#***********************************************************************************************************
|