Wait till the next query can be sent. Applicable in both single-thread and multi-thread environments.
(self)
| 165 | 'details.') |
| 166 | |
| 167 | def wait(self): |
| 168 | """Wait till the next query can be sent. |
| 169 | |
| 170 | Applicable in both single-thread and multi-thread environments. |
| 171 | """ |
| 172 | return self.token_bucket.get_token() |
| 173 | |
| 174 | def get_token_len(self, prompt: str) -> int: |
| 175 | """Get lengths of the tokenized string. Only English and Chinese |