Spaces:
Running
Running
romnatall
commited on
Commit
•
6a3534a
1
Parent(s):
f29c8e2
chache bert model
Browse files
pages/film_review/model/__pycache__/model_bert.cpython-312.pyc
ADDED
Binary file (2.59 kB). View file
|
|
pages/film_review/model/__pycache__/model_lstm.cpython-312.pyc
CHANGED
Binary files a/pages/film_review/model/__pycache__/model_lstm.cpython-312.pyc and b/pages/film_review/model/__pycache__/model_lstm.cpython-312.pyc differ
|
|
pages/film_review/model/model_bert.py
CHANGED
@@ -11,11 +11,11 @@ def get_model():
|
|
11 |
model = AutoModel.from_pretrained("cointegrated/rubert-tiny2")
|
12 |
tokenizer = AutoTokenizer.from_pretrained("cointegrated/rubert-tiny2")
|
13 |
return model, tokenizer
|
14 |
-
|
15 |
def predict_bert(input_text):
|
16 |
MAX_LEN = 300
|
17 |
|
18 |
-
|
19 |
|
20 |
tokenized_input = tokenizer.encode(input_text, add_special_tokens=True, truncation=True, max_length=MAX_LEN)
|
21 |
padded_input = np.array(tokenized_input + [0]*(MAX_LEN-len(tokenized_input)))
|
|
|
11 |
model = AutoModel.from_pretrained("cointegrated/rubert-tiny2")
|
12 |
tokenizer = AutoTokenizer.from_pretrained("cointegrated/rubert-tiny2")
|
13 |
return model, tokenizer
|
14 |
+
model, tokenizer = get_model()
|
15 |
def predict_bert(input_text):
|
16 |
MAX_LEN = 300
|
17 |
|
18 |
+
|
19 |
|
20 |
tokenized_input = tokenizer.encode(input_text, add_special_tokens=True, truncation=True, max_length=MAX_LEN)
|
21 |
padded_input = np.array(tokenized_input + [0]*(MAX_LEN-len(tokenized_input)))
|