minnehwg commited on
Commit
b6f0887
1 Parent(s): c83b4f4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -25,6 +25,7 @@ def predict_sentence(model, tokenizer, sentence):
25
  title = convert_label_to_title(predicted_class)
26
  return title, probabilities.numpy(), highest_probability
27
 
 
28
  def load_model(checkpoint, num_class):
29
  model = TFAutoModelForSequenceClassification.from_pretrained(checkpoint, num_labels=num_class)
30
  tokenizer = AutoTokenizer.from_pretrained(checkpoint)
 
25
  title = convert_label_to_title(predicted_class)
26
  return title, probabilities.numpy(), highest_probability
27
 
28
+ @st.cache(allow_output_mutation=True)
29
  def load_model(checkpoint, num_class):
30
  model = TFAutoModelForSequenceClassification.from_pretrained(checkpoint, num_labels=num_class)
31
  tokenizer = AutoTokenizer.from_pretrained(checkpoint)