Skip to content

Commit b995224

Browse files
committed
server : check if context can do shifts
ggml-ci
1 parent 59922e3 commit b995224

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tools/server/server.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2004,6 +2004,23 @@ struct server_context {
20042004
}
20052005
}
20062006

2007+
if (!llama_kv_self_can_shift(ctx)) {
2008+
if (params_base.ctx_shift) {
2009+
params_base.ctx_shift = false;
2010+
SRV_WRN("%s\n", "ctx_shift is not supported by this context, it will be disabled");
2011+
}
2012+
2013+
if (params_base.n_cache_reuse) {
2014+
params_base.n_cache_reuse = 0;
2015+
SRV_WRN("%s\n", "cache_reuse is not supported by this context, it will be disabled");
2016+
}
2017+
2018+
if (!params_base.speculative.model.path.empty()) {
2019+
SRV_ERR("%s\n", "err: speculative decode is not supported by this context");
2020+
return false;
2021+
}
2022+
}
2023+
20072024
return true;
20082025
}
20092026

0 commit comments

Comments
 (0)