(self, examples, labels, image=None, modal='image')
| 45 | print(f"Parameter count : {count}") |
| 46 | |
| 47 | def forward(self, examples, labels, image=None, modal='image'): |
| 48 | output = self.llma(examples, image=image, modal=modal) |
| 49 | output = output[:, :-1, :] |
| 50 | labels = labels[:, 1:] |
| 51 | |
| 52 | if labels.sum() == 0: |
| 53 | c_loss = output.mean() * 0 |
| 54 | else: |
| 55 | c_loss = self.criterion(output.reshape(-1, 32000), labels.flatten()) |
| 56 | |
| 57 | return c_loss |
| 58 | |
| 59 | def generate( |
| 60 | self, |
nothing calls this directly
no outgoing calls
no test coverage detected