Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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)
|