Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Commit

Permalink
fix wizard chat models
Browse files Browse the repository at this point in the history
  • Loading branch information
mitya52 committed Oct 14, 2023
1 parent ad93630 commit d7696ca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
13 changes: 7 additions & 6 deletions src/caps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,13 @@ const KNOWN_MODELS: &str = r#"
"n_ctx": 2048,
"supports_scratchpads": {
"CHAT-GENERIC": {
"token_esc": "\n\n",
"keyword_system": "",
"keyword_user": "USER: ",
"keyword_assistant": "ASSISTANT: ",
"stop_list": [],
"default_system_message": ""
"token_esc": "",
"keyword_system": "<s>",
"keyword_user": "\nUSER: ",
"keyword_assistant": "\nASSISTANT: ",
"eot": "",
"stop_list": ["\n\n"],
"default_system_message": "You are a helpful AI assistant.\n"
}
},
"similar_models": [
Expand Down
7 changes: 5 additions & 2 deletions src/scratchpads/chat_generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ impl ScratchpadAbstract for GenericChatScratchpad {
self.keyword_asst = patch.get("keyword_assistant").and_then(|x| x.as_str()).unwrap_or("ASSISTANT:").to_string();
self.default_system_message = patch.get("default_system_message").and_then(|x| x.as_str()).unwrap_or("").to_string();
self.t.eot = patch.get("eot").and_then(|x| x.as_str()).unwrap_or("<|endoftext|>").to_string();
self.t.assert_one_token(&self.t.eot.as_str())?;

self.dd.stop_list.clear();
self.dd.stop_list.push(self.t.eot.clone());
if !self.t.eot.is_empty() {
self.t.assert_one_token(&self.t.eot.as_str())?;
self.dd.stop_list.push(self.t.eot.clone());
}
if self.token_esc.len() > 0 {
self.dd.stop_list.push(self.token_esc.clone());
} else {
Expand Down

0 comments on commit d7696ca

Please sign in to comment.