inps: a torch tensor of shape [batch, sequence] the size of sequence may vary from call to call returns: a torch tensor of shape [batch, sequence, vocab] with the logits returned from the model
(self, inps)
| 158 | return self.tokenizer.decode(tokens) |
| 159 | |
| 160 | def _model_call(self, inps): |
| 161 | """ |
| 162 | inps: a torch tensor of shape [batch, sequence] |
| 163 | the size of sequence may vary from call to call |
| 164 | |
| 165 | returns: a torch tensor of shape [batch, sequence, vocab] with the |
| 166 | logits returned from the model |
| 167 | """ |
| 168 | with torch.no_grad(): |
| 169 | return self.model(inps)[0] |
| 170 | |
| 171 | def _model_generate(self, context, max_length, eos_token_id): |
| 172 | generation_kwargs = {"do_sample": False, "max_length": max_length} |
nothing calls this directly
no outgoing calls
no test coverage detected