mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-24 13:28:50 +01:00
main : insert bos if no tokens (#2727)
* main.cpp : insert bos if no tokens * Update examples/main/main.cpp * Update examples/main/main.cpp --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
This commit is contained in:
parent
cc34dbda96
commit
5290c38e6e
@ -197,6 +197,11 @@ int main(int argc, char ** argv) {
|
|||||||
embd_inp = session_tokens;
|
embd_inp = session_tokens;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Should not run without any tokens
|
||||||
|
if (embd_inp.empty()) {
|
||||||
|
embd_inp.push_back(llama_token_bos(ctx));
|
||||||
|
}
|
||||||
|
|
||||||
// Tokenize negative prompt
|
// Tokenize negative prompt
|
||||||
std::vector<llama_token> guidance_inp;
|
std::vector<llama_token> guidance_inp;
|
||||||
int guidance_offset = 0;
|
int guidance_offset = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user