Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
import torch
|
3 |
from transformers import DistilBertForSequenceClassification, DistilBertTokenizerFast
|
4 |
-
from utils import get_text, get_labels
|
5 |
|
6 |
count_labels = 8
|
7 |
|
@@ -15,8 +15,9 @@ abstract = st.text_area("Введите аннотацию к статье, abst
|
|
15 |
|
16 |
tokenizer = DistilBertTokenizerFast()
|
17 |
model = DistilBertForSequenceClassification()
|
18 |
-
|
19 |
-
model
|
|
|
20 |
|
21 |
text = get_text(title, abstract)
|
22 |
if text:
|
|
|
1 |
import streamlit as st
|
2 |
import torch
|
3 |
from transformers import DistilBertForSequenceClassification, DistilBertTokenizerFast
|
4 |
+
from utils import get_text, get_labels, load_model
|
5 |
|
6 |
count_labels = 8
|
7 |
|
|
|
15 |
|
16 |
tokenizer = DistilBertTokenizerFast()
|
17 |
model = DistilBertForSequenceClassification()
|
18 |
+
|
19 |
+
load_model(model, 'weight_model')
|
20 |
+
#model.load_state_dict(torch.load('weight_model'))
|
21 |
|
22 |
text = get_text(title, abstract)
|
23 |
if text:
|