(caption)
| 53 | float: The reward score. |
| 54 | """ |
| 55 | def _tokenize(caption): |
| 56 | input_ids = self.tokenizer( |
| 57 | caption, |
| 58 | max_length=self.tokenizer.model_max_length, |
| 59 | padding="max_length", |
| 60 | truncation=True, |
| 61 | return_tensors="pt" |
| 62 | ).input_ids |
| 63 | return input_ids |
| 64 | |
| 65 | text_input = _tokenize(prompt).to(self.device) |
| 66 | if self.condition == 'overall': |
nothing calls this directly
no outgoing calls
no test coverage detected