Update app.py
Browse files
app.py
CHANGED
|
@@ -18,11 +18,15 @@ MODEL_ID = "dejanseo/QDF"
|
|
| 18 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 19 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 20 |
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, token=HF_TOKEN)
|
| 23 |
-
|
| 24 |
-
# ← changed from model.to(device)
|
| 25 |
-
model = model.to_empty(device)
|
| 26 |
|
| 27 |
model.eval()
|
| 28 |
|
|
|
|
| 18 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 19 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 20 |
|
| 21 |
+
# ← updated block here
|
| 22 |
+
model = AutoModelForSequenceClassification.from_pretrained(
|
| 23 |
+
MODEL_ID,
|
| 24 |
+
token=HF_TOKEN,
|
| 25 |
+
low_cpu_mem_usage=False,
|
| 26 |
+
device_map=None
|
| 27 |
+
)
|
| 28 |
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, token=HF_TOKEN)
|
| 29 |
+
model.to(device)
|
|
|
|
|
|
|
| 30 |
|
| 31 |
model.eval()
|
| 32 |
|