Dzhamb commited on
Commit
ce814c7
1 Parent(s): c5b41d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
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
- @st.cache
19
- model.load_state_dict(torch.load('weight_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: