Add a comment clarifying where n_ctx - 4 came from
This commit is contained in:
parent
f5a790f761
commit
855ede7436
1 changed files with 2 additions and 0 deletions
|
@ -334,6 +334,8 @@ int main(int argc, char ** argv) {
|
|||
while ((n_remain != 0 && !is_antiprompt) || params.interactive) {
|
||||
// predict
|
||||
if (embd.size() > 0) {
|
||||
// Note: n_ctx - 4 here is to match the logic for commandline prompt handling via
|
||||
// --prompt or --file which uses the same value.
|
||||
auto max_embd_size = n_ctx - 4;
|
||||
// Ensure the input doesn't exceed the context size by truncating embd if necessary.
|
||||
if ((int)embd.size() > max_embd_size) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue