Spaces:
Sleeping
Sleeping
Commit ·
96e47fa
1
Parent(s): 6890975
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ from transformers import AutoModelForSequenceClassification, AutoTokenizer, Auto
|
|
| 4 |
import torch
|
| 5 |
|
| 6 |
# Define function to load models
|
| 7 |
-
@st.
|
| 8 |
def load_models():
|
| 9 |
classification_model_name = 'distilbert-base-uncased-finetuned-sst-2-english'
|
| 10 |
classification_model = AutoModelForSequenceClassification.from_pretrained(classification_model_name)
|
|
|
|
| 4 |
import torch
|
| 5 |
|
| 6 |
# Define function to load models
|
| 7 |
+
@st.cache_data(allow_output_mutation=True)
|
| 8 |
def load_models():
|
| 9 |
classification_model_name = 'distilbert-base-uncased-finetuned-sst-2-english'
|
| 10 |
classification_model = AutoModelForSequenceClassification.from_pretrained(classification_model_name)
|