Skip to content

Commit

Permalink
sample req without system prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoskal committed Nov 5, 2024
1 parent 7cd0a48 commit 6162249
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
9 changes: 5 additions & 4 deletions llgtrt/src/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,11 @@ impl ChatBuilder {
tools: &vec![],
json_schema: None,
messages: &vec![
ChatCompletionMessageParams::System {
content: ChatCompletionMessageContentPart::Text("Be a good model".to_string()),
name: None,
},
// Some models do not support System
// ChatCompletionMessageParams::System {
// content: ChatCompletionMessageContentPart::Text("Be a good model".to_string()),
// name: None,
// },
ChatCompletionMessageParams::User {
content: ChatCompletionMessageContentPart::Text("Hello".to_string()),
name: None,
Expand Down
8 changes: 8 additions & 0 deletions llgtrt/src/tokenizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ pub fn setup_tokenizer(
tok_cfg.eos_token
);
info.tok_eos = toks[0];
log::debug!(
"tok_eos: {:?} -> {}",
tok_cfg.eos_token.name(),
info.tok_eos
);

info.tok_bos = None;
if let Some(s) = &tok_cfg.bos_token {
Expand All @@ -99,6 +104,9 @@ pub fn setup_tokenizer(
s
);
info.tok_bos = Some(toks[0]);
log::debug!("tok_bos: {:?} -> {}", s.name(), info.tok_bos.unwrap());
} else {
log::debug!("tok_bos: None");
}

let tok_env = Arc::new(TokEnvWithTrie::new(tok_env.clone(), trie.with_info(info)));
Expand Down

0 comments on commit 6162249

Please sign in to comment.