Commit
·
cb60597
1
Parent(s):
66ac73d
checking if other model thigns are needed
Browse files- modeling_lang.py +8 -8
modeling_lang.py
CHANGED
|
@@ -48,11 +48,11 @@ class ExtendedMultitaskModelForTokenClassification(PreTrainedModel):
|
|
| 48 |
def device(self):
|
| 49 |
return next(self.parameters()).device
|
| 50 |
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
|
|
|
| 48 |
def device(self):
|
| 49 |
return next(self.parameters()).device
|
| 50 |
|
| 51 |
+
@classmethod
|
| 52 |
+
def from_pretrained(cls, *args, **kwargs):
|
| 53 |
+
# print("Ignoring weights and using custom initialization.")
|
| 54 |
+
# Manually create the config
|
| 55 |
+
config = ImpressoConfig(**kwargs)
|
| 56 |
+
# Pass the manually created config to the class
|
| 57 |
+
model = cls(config)
|
| 58 |
+
return model
|