Spaces:
Build error
Build error
PeteBleackley
commited on
Commit
·
b5ce6f8
1
Parent(s):
a0c9643
Unpack BatchEncoding
Browse files
qarac/models/QaracEncoderModel.py
CHANGED
|
@@ -47,7 +47,8 @@ class QaracEncoderModel(transformers.PreTrainedModel):
|
|
| 47 |
Vector representing the document
|
| 48 |
|
| 49 |
"""
|
| 50 |
-
|
|
|
|
| 51 |
return self.head(self.encoder(input_ids,
|
| 52 |
attention_mask).last_hidden_state,
|
| 53 |
attention_mask)
|
|
|
|
| 47 |
Vector representing the document
|
| 48 |
|
| 49 |
"""
|
| 50 |
+
if attention_mask is None and 'attention_mask' in input_ids:
|
| 51 |
+
(input_ids,attention_mask) = (input_ids['input_ids'],input_ids['attention_mask'])
|
| 52 |
return self.head(self.encoder(input_ids,
|
| 53 |
attention_mask).last_hidden_state,
|
| 54 |
attention_mask)
|