Replies: 2 comments
-
|
You can inspect the tokens evaluated onto a context sequence (the tokens representation of the current evaluation state) by either logging the textual representation of the tokens (including special tokens), or by converting the context tokens into a import {LlamaText} from "node-llama-cpp";
console.log("contextState", model.detokenize(session.sequence.contextTokens, /* specialTokens */ true));
console.log("LlamaText", LlamaText.fromTokens(model.tokenizer, session.sequence.contextTokens));I recommend the You can generate a It's worth noting that |
Beta Was this translation helpful? Give feedback.
-
|
Thank you so much for that fast and detailed response. That's exactly what I wanted. I kind of did by myself what you mentioned: I do it because I want to look deeper into what the different models are doing under the hood and build up a deeper understanding. I really love your package and I can't stop playing around with it! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
How can I see the raw prompt that’s actually sent to the LLM by node-llama-cpp. Including all system messages, role formatting, special tokens, and any injected context or formatting (like <|system|> / <|user|> / <|assistant|> sections)?
I’d like to inspect the exact string that gets passed to the model for debugging or understanding how my inputs are structured before inference.
Is there a built-in way (e.g. a debug flag, callback, or verbose option) to log or print that full formatted prompt, or do I need to modify the source / intercept it manually?
Beta Was this translation helpful? Give feedback.
All reactions