(self, request, context)
| 254 | pass |
| 255 | |
| 256 | async def TokenizeString(self, request, context): |
| 257 | if not getattr(self, "tokenizer", None): |
| 258 | context.set_code(grpc.StatusCode.FAILED_PRECONDITION) |
| 259 | context.set_details("tokenizer not loaded") |
| 260 | return backend_pb2.TokenizationResponse() |
| 261 | try: |
| 262 | tokens = self.tokenizer.encode(request.Prompt) |
| 263 | return backend_pb2.TokenizationResponse(length=len(tokens), tokens=tokens) |
| 264 | except Exception as e: |
| 265 | context.set_code(grpc.StatusCode.INTERNAL) |
| 266 | context.set_details(str(e)) |
| 267 | return backend_pb2.TokenizationResponse() |
| 268 | |
| 269 | async def Free(self, request, context): |
| 270 | try: |
nothing calls this directly
no test coverage detected