Skip to content

Commit 333eeed

Browse files
committed
fix for use of models without n_swa
1 parent 16b73d4 commit 333eeed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/llama-graph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ void llm_graph_input_attn_no_cache::set_input(const llama_ubatch * ubatch) {
347347
const int64_t pos_diff = pos_j - pos_i;
348348

349349
if (hparams.use_alibi &&
350-
(pos_diff >= -half_n_swa && pos_diff <= half_n_swa)) {
350+
(hparams.n_swa == 0 || (pos_diff >= -half_n_swa && pos_diff <= half_n_swa))) {
351351
f = -std::abs(ubatch->pos[ti] - ubatch->pos[tj]);
352352
} else {
353353
f = 0.0f;

0 commit comments

Comments
 (0)