Update app.py
Browse files
app.py
CHANGED
|
@@ -20,8 +20,8 @@ print(f"Using device: {device}")
|
|
| 20 |
print(f"Loading model: {MODEL_ID}...")
|
| 21 |
try:
|
| 22 |
# Load tokenizer and model, providing the token for private access
|
| 23 |
-
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, token=HF_TOKEN)
|
| 24 |
-
model = AutoModelForSequenceClassification.from_pretrained(MODEL_ID, token=HF_TOKEN)
|
| 25 |
|
| 26 |
# Move the model to the selected device ONCE for efficiency
|
| 27 |
model.to(device)
|
|
|
|
| 20 |
print(f"Loading model: {MODEL_ID}...")
|
| 21 |
try:
|
| 22 |
# Load tokenizer and model, providing the token for private access
|
| 23 |
+
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, token=HF_TOKEN, trust_remote_code=True)
|
| 24 |
+
model = AutoModelForSequenceClassification.from_pretrained(MODEL_ID, token=HF_TOKEN,trust_remote_code=True, num_labels=3)
|
| 25 |
|
| 26 |
# Move the model to the selected device ONCE for efficiency
|
| 27 |
model.to(device)
|