ilushado commited on
Commit
47cd355
·
1 Parent(s): 59add47

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -51,12 +51,14 @@ class RobertaClass(torch.nn.Module):
51
  output = self.classifier(pooler)
52
  return output
53
 
 
54
  tokenizer = RobertaTokenizer.from_pretrained('roberta-base', truncation=True, do_lower_case=True,
55
  vocab_file='model/vocab.json',
56
  merges_file='model/merges.txt')
57
 
58
 
59
 
 
60
  model = torch.load('model/pytorch_roberta_sentiment.bin', map_location=torch.device('cpu'))
61
 
62
 
 
51
  output = self.classifier(pooler)
52
  return output
53
 
54
+ @st.cache
55
  tokenizer = RobertaTokenizer.from_pretrained('roberta-base', truncation=True, do_lower_case=True,
56
  vocab_file='model/vocab.json',
57
  merges_file='model/merges.txt')
58
 
59
 
60
 
61
+ @st.cache
62
  model = torch.load('model/pytorch_roberta_sentiment.bin', map_location=torch.device('cpu'))
63
 
64