Dzhamb commited on
Commit
a483514
1 Parent(s): 13f47f1

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +3 -0
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