Trobleshoot Huggingface Temp
Browse files
app.py
CHANGED
|
@@ -12,9 +12,11 @@ model = load_model("model_stresss.h5")
|
|
| 12 |
labels = ['Tidak Stress', 'Sedikit Stress', 'Normal', 'Stress', 'Sangat Stress']
|
| 13 |
|
| 14 |
# Load model Hugging Face
|
|
|
|
|
|
|
| 15 |
model_dir = "Chipan/indobert-emotion"
|
| 16 |
-
tokenizer = AutoTokenizer.from_pretrained(model_dir)
|
| 17 |
-
model_bert = AutoModelForSequenceClassification.from_pretrained(model_dir)
|
| 18 |
model_bert.eval()
|
| 19 |
|
| 20 |
# Mapping label untuk emosi
|
|
|
|
| 12 |
labels = ['Tidak Stress', 'Sedikit Stress', 'Normal', 'Stress', 'Sangat Stress']
|
| 13 |
|
| 14 |
# Load model Hugging Face
|
| 15 |
+
cache_path = "/tmp/huggingface"
|
| 16 |
+
|
| 17 |
model_dir = "Chipan/indobert-emotion"
|
| 18 |
+
tokenizer = AutoTokenizer.from_pretrained(model_dir, cache_dir=cache_path)
|
| 19 |
+
model_bert = AutoModelForSequenceClassification.from_pretrained(model_dir, cache_dir=cache_path)
|
| 20 |
model_bert.eval()
|
| 21 |
|
| 22 |
# Mapping label untuk emosi
|