Skip to content

Commit

Permalink
fix qwen2 prompt.
Browse files Browse the repository at this point in the history
  • Loading branch information
wangzhaode committed Feb 4, 2024
1 parent 5fe3b66 commit c5e4895
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/llm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,8 @@ bool Llama2_7b::is_stop(int token_id) {

std::vector<int> Qwen2_4b::tokenizer(const std::string& query) {
auto ids = tokenizer_encode(query);
// auto prompt = "\n<|im_start|>user\n" + query + "<|im_end|>\n<|im_start|>assistant\n";
ids.insert(ids.begin(), {198, 151644, 872, 198});
// auto prompt = "<|im_start|>user\n" + query + "<|im_end|>\n<|im_start|>assistant\n";
ids.insert(ids.begin(), {151644, 872, 198});
ids.insert(ids.end(), {151645, 198, 151644, 77091, 198});
return ids;
}
Expand Down Expand Up @@ -1321,4 +1321,4 @@ std::string Pipeline::build_prompt(const std::string& str) {
prompt += assistant_ + "";
return prompt;
}
// Pipeline end
// Pipeline end

0 comments on commit c5e4895

Please sign in to comment.