Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,7 +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 |
-
@st.
|
| 29 |
def load_model(checkpoint, num_class):
|
| 30 |
model = TFAutoModelForSequenceClassification.from_pretrained(checkpoint, num_labels=num_class)
|
| 31 |
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
|
|
|
| 25 |
title = convert_label_to_title(predicted_class)
|
| 26 |
return title, probabilities.numpy(), highest_probability
|
| 27 |
|
| 28 |
+
@st.cache_resource
|
| 29 |
def load_model(checkpoint, num_class):
|
| 30 |
model = TFAutoModelForSequenceClassification.from_pretrained(checkpoint, num_labels=num_class)
|
| 31 |
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|