Spaces:
Runtime error
Runtime error
Update utils.py
Browse files
utils.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import torch
|
|
|
2 |
import streamlit as st
|
3 |
|
4 |
|
@@ -33,6 +34,8 @@ def get_labels(text, model, tokenizer, count_labels=8):
|
|
33 |
|
34 |
@st.cache(allow_output_mutation=True)
|
35 |
def load_model():
|
|
|
|
|
36 |
model.load_state_dict(torch.load('weight_model'))
|
37 |
return model
|
38 |
|
|
|
1 |
import torch
|
2 |
+
from transformers import DistilBertForSequenceClassification, DistilBertTokenizerFast
|
3 |
import streamlit as st
|
4 |
|
5 |
|
|
|
34 |
|
35 |
@st.cache(allow_output_mutation=True)
|
36 |
def load_model():
|
37 |
+
tokenizer = DistilBertTokenizerFast()
|
38 |
+
model = DistilBertForSequenceClassification()
|
39 |
model.load_state_dict(torch.load('weight_model'))
|
40 |
return model
|
41 |
|