diff --git a/src/program/generate.cpp b/src/program/generate.cpp index 3cef8621..48245995 100644 --- a/src/program/generate.cpp +++ b/src/program/generate.cpp @@ -15482,7 +15482,7 @@ int main(int argc, char** argv) { // ---- plan v0.3 P5: the prompt's conditioning positions [0, n_prompt - 1) in batched chunks. The token loop // then starts at the last prompt position, whose prediction is the first generated token. int64_t pos_start = 0; - int64_t spec_pos = 0; // plan v0.3 P6: where the speculative loop starts (0 = not used) + int64_t spec_pos = -1; // plan v0.3 P6: where the speculative loop starts (-1 = not used; 0 is a real position: a 1-token prompt on a native pack) strata::prefill::Prefill prefill; // #1595: not by default when the cache holds every expert (nothing to take) strata::prefill::Prefill::arm_cpu_share(!multi_gpu && !o.no_pool, @@ -15872,7 +15872,7 @@ int main(int argc, char** argv) { // round emits (accepted drafts + 1) tokens. `commit` keeps the state of the tokens that were emitted. const bool ended = o.stop_eos && !produced.empty() && std::find(o.eos_ids.begin(), o.eos_ids.end(), (int64_t) produced.back()) != o.eos_ids.end(); - if (spec_pos > 0 && (int64_t) produced.size() < o.max_new && !ended) { + if (spec_pos >= 0 && (int64_t) produced.size() < o.max_new && !ended) { auto read_ids = [](const std::string& path, std::vector& ids) { std::ifstream in(path); std::string text((std::istreambuf_iterator(in)), std::istreambuf_iterator());