Spaces:
Sleeping
Sleeping
Merge branch 'main' of https://huggingface.co/spaces/shivamjadhav/albert_latest_96
Browse files
classifier/Albert_latest.py
CHANGED
@@ -12,7 +12,7 @@ class Model:
|
|
12 |
checkpoint = torch.load(model_weights, map_location=self.device)
|
13 |
|
14 |
# Load the model's state dictionary
|
15 |
-
self.model.load_state_dict(checkpoint['model_state_dict'])
|
16 |
self.currepoch = checkpoint['epoch']
|
17 |
self.loss = checkpoint['loss']
|
18 |
print(f"Loaded model state: Current epoch {self.currepoch}, current loss {self.loss}")
|
|
|
12 |
checkpoint = torch.load(model_weights, map_location=self.device)
|
13 |
|
14 |
# Load the model's state dictionary
|
15 |
+
self.model.load_state_dict(checkpoint['model_state_dict'],strict=False)
|
16 |
self.currepoch = checkpoint['epoch']
|
17 |
self.loss = checkpoint['loss']
|
18 |
print(f"Loaded model state: Current epoch {self.currepoch}, current loss {self.loss}")
|