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

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +5 -1
utils.py CHANGED
@@ -1,4 +1,5 @@
1
  import torch
 
2
 
3
 
4
  def get_text(title: str, abstract: str):
@@ -29,5 +30,8 @@ def get_labels(text, model, tokenizer, count_labels=8):
29
  if cumsum > 0.95 and len(result_labels) >= 1:
30
  return result_labels
31
  result_labels.append(pair[1])
32
-
 
 
 
33
 
 
1
  import torch
2
+ import streamlit as st
3
 
4
 
5
  def get_text(title: str, abstract: str):
 
30
  if cumsum > 0.95 and len(result_labels) >= 1:
31
  return result_labels
32
  result_labels.append(pair[1])
33
+
34
+ @st.cache
35
+ def load_model(model, filename):
36
+ return model.load_state_dict(torch.load(filename))
37