server : do not init sampler if not needed

This commit is contained in:
Georgi Gerganov 2026-01-14 12:06:35 +02:00
parent ffa0d15e86
commit be9e6ef2c0
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735
1 changed files with 6 additions and 2 deletions

View File

@ -196,10 +196,14 @@ struct server_slot {
}
void init_sampler() const {
const int64_t t_start = ggml_time_us();
common_sampler_reset(smpl.get());
if (!task->need_sampling()) {
return;
}
const int64_t t_start = ggml_time_us();
int n_text = 0;
for (int i = 0; i < (int) prompt.tokens.size(); i++) {