Commit
·
c05f3d0
1
Parent(s):
cb60597
checking if other model thigns are needed
Browse files- modeling_lang.py +1 -9
modeling_lang.py
CHANGED
|
@@ -21,7 +21,7 @@ class ExtendedMultitaskModelForTokenClassification(PreTrainedModel):
|
|
| 21 |
self.model_floret = floret.load_model(self.config.config.filename)
|
| 22 |
|
| 23 |
#
|
| 24 |
-
def forward(self, input_ids,
|
| 25 |
if isinstance(input_ids, str):
|
| 26 |
# If the input is a single string, make it a list for floret
|
| 27 |
texts = [input_ids]
|
|
@@ -36,14 +36,6 @@ class ExtendedMultitaskModelForTokenClassification(PreTrainedModel):
|
|
| 36 |
probabilities,
|
| 37 |
)
|
| 38 |
|
| 39 |
-
# def state_dict(self, *args, **kwargs):
|
| 40 |
-
# # Return an empty state dictionary
|
| 41 |
-
# return {}
|
| 42 |
-
#
|
| 43 |
-
# def load_state_dict(self, state_dict, strict=True, **kwargs):
|
| 44 |
-
# # Ignore loading since there are no parameters
|
| 45 |
-
# pass
|
| 46 |
-
|
| 47 |
@property
|
| 48 |
def device(self):
|
| 49 |
return next(self.parameters()).device
|
|
|
|
| 21 |
self.model_floret = floret.load_model(self.config.config.filename)
|
| 22 |
|
| 23 |
#
|
| 24 |
+
def forward(self, input_ids, **kwargs):
|
| 25 |
if isinstance(input_ids, str):
|
| 26 |
# If the input is a single string, make it a list for floret
|
| 27 |
texts = [input_ids]
|
|
|
|
| 36 |
probabilities,
|
| 37 |
)
|
| 38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
@property
|
| 40 |
def device(self):
|
| 41 |
return next(self.parameters()).device
|