Upload folder using huggingface_hub
Browse files- modelling_medicap.py +1 -1
modelling_medicap.py
CHANGED
@@ -176,7 +176,7 @@ class MedICapEncoderDecoderModel(VisionEncoderDecoderModel):
|
|
176 |
embeddings = self.decoder.transformer.wte(decoder_input_ids)
|
177 |
embeddings = torch.cat([encoder_outputs[0], embeddings], dim=1)
|
178 |
|
179 |
-
if decoder_attention_mask:
|
180 |
decoder_attention_mask = torch.cat(
|
181 |
[
|
182 |
torch.ones(encoder_outputs[0].shape[:-1], dtype=decoder_attention_mask.dtype, device=self.device),
|
|
|
176 |
embeddings = self.decoder.transformer.wte(decoder_input_ids)
|
177 |
embeddings = torch.cat([encoder_outputs[0], embeddings], dim=1)
|
178 |
|
179 |
+
if torch.is_tensor(decoder_attention_mask):
|
180 |
decoder_attention_mask = torch.cat(
|
181 |
[
|
182 |
torch.ones(encoder_outputs[0].shape[:-1], dtype=decoder_attention_mask.dtype, device=self.device),
|