Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aien-sovereign-core-mv/blob/main/om/ribbon/q38-scoped-input-tokens.rs.txt # aien-sovereign-core-mv AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aien-sovereign-core-mv / om / ribbon / q38-scoped-input-tokens.rs.txt` 14 lines ยท 847 bytes Raw Blame History 1 // External input identity instrument; no model implementation. 2 use aien_inference_abi::tokenizer::{ChatOptions, ChatTokenizer}; 3 use serde_json::{json,Value}; 4 use std::path::Path; 5 fn main()->Result<(),Box>{ 6 let a:Vec=std::env::args().collect(); assert_eq!(a.len(),4); 7 let j:Value=serde_json::from_slice(&std::fs::read(&a[2])?)?; 8 let turns:Vec<(&str,&str)>=j["messages"].as_array().ok_or("messages")?.iter().map(|m|(m["role"].as_str().unwrap(),m["content"].as_str().unwrap())).collect(); 9 let t=ChatTokenizer::from_model_dir(Path::new(&a[1]),None)?; 10 let text=t.try_format_chat_with(&turns,&ChatOptions{enable_thinking:Some(false),..Default::default()})?; 11 let ids=t.encode(&text)?; 12 std::fs::write(&a[3],serde_json::to_vec_pretty(&json!({"input_ids":ids,"count":ids.len(),"enable_thinking":false}))?)?; 13 Ok(()) 14 }