MCPcopy Create free account
hub / github.com/Agent-RL/ReCall / forward

Method forward

src/flashrag/generator/fid.py:198–206  ·  view source on GitHub ↗
(self, input_ids=None, attention_mask=None,**kwargs)

Source from the content-addressed store, hash-verified

196 apply_checkpoint_wrapper(self.encoder, use_checkpoint)
197
198 def forward(self, input_ids=None, attention_mask=None,**kwargs):
199 bsz, total_length = input_ids.shape
200 passage_length = total_length // self.n_passages
201 # total_input
202 input_ids = input_ids.view(bsz*self.n_passages, passage_length)
203 attention_mask = attention_mask.view(bsz*self.n_passages, passage_length)
204 outputs = self.encoder(input_ids=input_ids, attention_mask=attention_mask, **kwargs)
205 outputs.last_hidden_state = outputs.last_hidden_state.view(bsz, self.n_passages*passage_length, -1)
206 return outputs

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected