MCPcopy Create free account
hub / github.com/tinygrad/tinygrad / encodeRole

Function encodeRole

examples/tinychat/tinychat-browser/index.js:912–919  ·  view source on GitHub ↗
(role)

Source from the content-addressed store, hash-verified

910 },
911
912 encodeRole(role) {
913 const tokens = [];
914 tokens.push(special_tokens["<|start_header_id|>"]);
915 tokens.push(...this.encode(role));
916 tokens.push(special_tokens["<|end_header_id|>"]);
917 tokens.push(...this.encode("\n\n"));
918 return tokens;
919 },
920
921 encodeMessage(role, content) {
922 const roleTokens = this.encodeRole(role);

Callers

nothing calls this directly

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…