Răsfoiți Sursa

server : fix SWA condition for full context reprocess (#14163)

ggml-ci
Georgi Gerganov 7 luni în urmă
părinte
comite
ffad043973
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      tools/server/server.cpp

+ 1 - 1
tools/server/server.cpp

@@ -3217,7 +3217,7 @@ struct server_context {
                                 }
 
                                 const auto n_swa = llama_model_n_swa(model);
-                                if (pos_min > slot.n_past - n_swa) {
+                                if (pos_min > std::max(0, slot.n_past - n_swa)) {
                                     SLT_WRN(slot, "n_past = %d, cache_tokens.size() = %d, seq_id = %d, pos_min = %d, n_swa = %d\n", slot.n_past, (int) slot.cache_tokens.size(), slot.id, pos_min, n_swa);
                                     SLT_WRN(slot, "forcing full prompt re-processing due to lack of cache data (likely due to SWA, see %s)\n",
                                             "https://github.com/ggml-org/llama.cpp/pull/13194#issuecomment-2868343055");