(self, input_ids, attention_mask, padding_side="right")
| 112 | pass |
| 113 | |
| 114 | def forward(self, input_ids, attention_mask, padding_side="right"): |
| 115 | # Block 1: Run Gemma model |
| 116 | outputs = self.model( |
| 117 | input_ids=input_ids, |
| 118 | attention_mask=attention_mask, |
| 119 | output_hidden_states=True, |
| 120 | ) |
| 121 | all_layer_hiddens = torch.stack(outputs.hidden_states, dim=-1) # [B, T, D, L] |
| 122 | |
| 123 | # Block 2: Feature extraction |
| 124 | features = self.feature_extractor( |
| 125 | all_layer_hiddens, attention_mask, padding_side |
| 126 | ) |
| 127 | return features # dict with "video" and optionally "audio" |
| 128 | |
| 129 | def encode_token_weights(self, token_weight_pairs): |
| 130 | token_pairs = token_weight_pairs["gemma"] |
nothing calls this directly
no outgoing calls
no test coverage detected