MCPcopy Index your code
hub / github.com/ceifa/tiktoken-node / encode

Method encode

src/lib.rs:13–19  ·  view source on GitHub ↗
(&self, text: String)

Source from the content-addressed store, hash-verified

11impl Encoding {
12 #[napi]
13 pub fn encode(&self, text: String) -> Vec<u32> {
14 self.encoding
15 .encode_with_special_tokens(&text)
16 .iter()
17 .map(|x| *x as u32)
18 .collect()
19 }
20
21 #[napi]
22 pub fn decode(&self, tokens: Vec<u32>) -> Result<String, Error> {

Callers 1

index.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected