Upload folder using huggingface_hub
Browse files
modeling_pantagruel_uni.py
CHANGED
|
@@ -1555,6 +1555,7 @@ class PantagruelUniModel(PantagruelUniPreTrainedModel):
|
|
| 1555 |
self,
|
| 1556 |
input_values=None, # audio input
|
| 1557 |
input_ids=None, # text input
|
|
|
|
| 1558 |
attention_mask=None,
|
| 1559 |
padding_mask=None,
|
| 1560 |
mask=False,
|
|
@@ -1623,7 +1624,7 @@ class PantagruelUniModel(PantagruelUniPreTrainedModel):
|
|
| 1623 |
mode = "TEXT" if input_ids is not None else "AUDIO"
|
| 1624 |
|
| 1625 |
if padding_mask is None and attention_mask is not None:
|
| 1626 |
-
padding_mask = ~attention_mask # attention mask: 1 means to attend to (not masked), 0 means not to attend to (masked). padding mask: 1 means padded (not attend to), 0 means not padded (to attend to)
|
| 1627 |
|
| 1628 |
feature_extractor = self.modality_encoders[mode]
|
| 1629 |
extractor_out = feature_extractor(
|
|
|
|
| 1555 |
self,
|
| 1556 |
input_values=None, # audio input
|
| 1557 |
input_ids=None, # text input
|
| 1558 |
+
token_type_ids=None,
|
| 1559 |
attention_mask=None,
|
| 1560 |
padding_mask=None,
|
| 1561 |
mask=False,
|
|
|
|
| 1624 |
mode = "TEXT" if input_ids is not None else "AUDIO"
|
| 1625 |
|
| 1626 |
if padding_mask is None and attention_mask is not None:
|
| 1627 |
+
padding_mask = ~attention_mask.bool() # attention mask: 1 means to attend to (not masked), 0 means not to attend to (masked). padding mask: 1 means padded (not attend to), 0 means not padded (to attend to)
|
| 1628 |
|
| 1629 |
feature_extractor = self.modality_encoders[mode]
|
| 1630 |
extractor_out = feature_extractor(
|