Spaces:
Sleeping
Sleeping
Update pages/imdb.py
Browse files- pages/imdb.py +6 -6
pages/imdb.py
CHANGED
@@ -8,6 +8,8 @@ import re
|
|
8 |
import string
|
9 |
from collections import Counter
|
10 |
|
|
|
|
|
11 |
from gensim.models import Word2Vec
|
12 |
from string import punctuation
|
13 |
import transformers
|
@@ -138,12 +140,10 @@ def main():
|
|
138 |
|
139 |
start1 = time.time()
|
140 |
|
141 |
-
|
142 |
-
'distilbert-base-uncased
|
143 |
-
|
144 |
-
|
145 |
-
'distilbert-base-uncased-finetuned-sst-2-english'
|
146 |
-
)
|
147 |
|
148 |
|
149 |
input_tokens = autotoken(
|
|
|
8 |
import string
|
9 |
from collections import Counter
|
10 |
|
11 |
+
from transformers import AutoConfig, AutoTokenizer, AutoModel, AutoModelForSequenceClassification, Trainer, TrainingArguments
|
12 |
+
|
13 |
from gensim.models import Word2Vec
|
14 |
from string import punctuation
|
15 |
import transformers
|
|
|
140 |
|
141 |
start1 = time.time()
|
142 |
|
143 |
+
tokenizer = AutoTokenizer.from_pretrained("distilbert-base-uncased")
|
144 |
+
config = AutoConfig.from_pretrained('distilbert-base-uncased', num_labels=2)
|
145 |
+
|
146 |
+
automodel = AutoModelForSequenceClassification.from_config(config)
|
|
|
|
|
147 |
|
148 |
|
149 |
input_tokens = autotoken(
|