Fix tokenizer loading
Browse files
app.py
CHANGED
|
@@ -37,8 +37,17 @@ class EmotionClassifier(nn.Module):
|
|
| 37 |
|
| 38 |
# Load model and tokenizer
|
| 39 |
print("Loading model...")
|
| 40 |
-
tokenizer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
model = EmotionClassifier(MODEL_NAME, len(EMOTION_LABELS)).to(DEVICE)
|
|
|
|
| 42 |
|
| 43 |
# Load trained weights
|
| 44 |
try:
|
|
|
|
| 37 |
|
| 38 |
# Load model and tokenizer
|
| 39 |
print("Loading model...")
|
| 40 |
+
print(f"Loading tokenizer from {MODEL_NAME}...")
|
| 41 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
| 42 |
+
MODEL_NAME,
|
| 43 |
+
use_fast=True,
|
| 44 |
+
trust_remote_code=False
|
| 45 |
+
)
|
| 46 |
+
print("✓ Tokenizer loaded")
|
| 47 |
+
|
| 48 |
+
print(f"Initializing model architecture...")
|
| 49 |
model = EmotionClassifier(MODEL_NAME, len(EMOTION_LABELS)).to(DEVICE)
|
| 50 |
+
print("✓ Model architecture created")
|
| 51 |
|
| 52 |
# Load trained weights
|
| 53 |
try:
|