MCPcopy Create free account
hub / github.com/evilsocket/cake / encode_header

Method encode_header

cake-core/src/models/llama3/history.rs:14–16  ·  view source on GitHub ↗
(message: &Message)

Source from the content-addressed store, hash-verified

12// Adapted from https://github.com/meta-llama/llama3/blob/main/llama/tokenizer.py#L202
13impl History {
14 fn encode_header(message: &Message) -> String {
15 format!("<|start_header_id|>{}<|end_header_id|>\n\n", message.role)
16 }
17
18 fn encode_message(message: &Message) -> String {
19 Self::encode_header(message) + message.content.trim() + "<|eot_id|>"

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected