Spaces:
Running
Running
Commit
·
41fecdc
1
Parent(s):
9fc62df
renamed api.py->app.py
Browse files
classifier/Albert_latest.py
CHANGED
@@ -4,7 +4,7 @@ import torch
|
|
4 |
class Model:
|
5 |
def __init__(self, model_weights):
|
6 |
self.tokenizer = AlbertTokenizer.from_pretrained('albert-base-v2')
|
7 |
-
self.model = AlbertForSequenceClassification.from_pretrained('albert-base-v2', num_labels=
|
8 |
self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
9 |
|
10 |
# Load the checkpoint
|
|
|
4 |
class Model:
|
5 |
def __init__(self, model_weights):
|
6 |
self.tokenizer = AlbertTokenizer.from_pretrained('albert-base-v2')
|
7 |
+
self.model = AlbertForSequenceClassification.from_pretrained('albert-base-v2', num_labels=5)
|
8 |
self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
9 |
|
10 |
# Load the checkpoint
|