(
body: TokenizeInputRequest,
llama_proxy: LlamaProxy = Depends(get_llama_proxy),
)
| 574 | tags=[extras_tag], |
| 575 | ) |
| 576 | async def count_query_tokens( |
| 577 | body: TokenizeInputRequest, |
| 578 | llama_proxy: LlamaProxy = Depends(get_llama_proxy), |
| 579 | ) -> TokenizeInputCountResponse: |
| 580 | tokens = llama_proxy(body.model).tokenize(body.input.encode("utf-8"), special=True) |
| 581 | |
| 582 | return TokenizeInputCountResponse(count=len(tokens)) |
| 583 | |
| 584 | |
| 585 | @router.post( |
nothing calls this directly
no test coverage detected
searching dependent graphs…