MCPcopy Index your code
hub / github.com/tinygrad/tinygrad / token_encode

Function token_encode

examples/llama3.py:364–366  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

362 return json.dumps(len(tokenizer.encode(rjson.get("text", ""))))
363 @app.post("/v1/token/encode")
364 def token_encode():
365 rjson = json.loads(request.body.read())
366 return json.dumps(tokenizer.encode(rjson.get("text", "")))
367
368 @app.post("/v1/completions")
369 def completions():

Callers

nothing calls this directly

Calls 3

readMethod · 0.45
encodeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…