set to the short freq factor when context size is small than trained context size

This commit is contained in:
liuwei 2024-05-11 20:30:32 +00:00 committed by Georgi Gerganov
parent b1f491a297
commit d05ae12e93
No known key found for this signature in database
GPG key ID: 449E073F9DC10735

View file

@ -10983,7 +10983,7 @@ static void llama_set_inputs(llama_context & lctx, const llama_batch & batch) {
ggml_backend_tensor_set(lctx.freq_factors, hparams.rope_long_factors.data(), 0, freq_dim * ggml_element_size(lctx.freq_factors));
}
else {
ggml_backend_tensor_set(lctx.freq_factors, hparams.rope_long_factors.data(), 0, freq_dim * ggml_element_size(lctx.freq_factors));
ggml_backend_tensor_set(lctx.freq_factors, hparams.rope_short_factors.data(), 0, freq_dim * ggml_element_size(lctx.freq_factors));
}
}