MCPcopy Create free account
hub / github.com/RL-Align/RL-Kernel / FakeBothModel

Class FakeBothModel

tests/test_stateless_executor.py:220–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218 rewards = torch.tensor([0.2, 0.8])
219
220 class FakeBothModel(torch.nn.Module):
221 def __init__(self):
222 super().__init__()
223 self.calls = 0
224
225 def forward(self, input_ids, attention_mask=None, use_cache=None):
226 del attention_mask
227 assert use_cache is False
228 self.calls += 1
229 return {
230 "logits": logits[: input_ids.shape[0], : input_ids.shape[1]],
231 "rewards": rewards,
232 }
233
234 model = FakeBothModel()
235 executor = StatelessForwardExecutor(model, StatelessForwardConfig(mode="both"))

Calls

no outgoing calls