Not Used for ONNXGenerativeModel class - Quick approximate token counter - uses default tokenizer so may have minor differences from the model's actual tokenization.
(self, text_sample)
| 3338 | return self.api_key |
| 3339 | |
| 3340 | def token_counter(self, text_sample): |
| 3341 | |
| 3342 | """ Not Used for ONNXGenerativeModel class - Quick approximate token counter - |
| 3343 | uses default tokenizer so may have minor differences from the model's actual tokenization. """ |
| 3344 | |
| 3345 | tokenizer = Utilities().get_default_tokenizer() |
| 3346 | toks = tokenizer.encode(text_sample).ids |
| 3347 | |
| 3348 | return len(toks) |
| 3349 | |
| 3350 | def prompt_engineer(self, query, context, inference_dict): |
| 3351 |
nothing calls this directly
no test coverage detected