diff --git a/src/prefill/prefill.cpp b/src/prefill/prefill.cpp index 2dcdb543..6731b3c8 100644 --- a/src/prefill/prefill.cpp +++ b/src/prefill/prefill.cpp @@ -927,6 +927,7 @@ struct PfTimer { } // namespace bool Prefill::run(const int64_t* tokens, int64_t n, int64_t pos0, std::string& err) { + err.clear(); Impl& m = *impl_; const core::OnDevice on_device(m.device); const core::ModelGeometry& g = *m.g; diff --git a/src/program/generate.cpp b/src/program/generate.cpp index 0bbc92e0..3b0bba44 100644 --- a/src/program/generate.cpp +++ b/src/program/generate.cpp @@ -3559,6 +3559,7 @@ int main(int argc, char** argv) { ~BusyScope() { strata::core::progress().busy.store(false); strata::core::progress_at("idle"); } } busy_scope; stop_req.store(false); // a STOP that arrived between requests is stale + err.clear(); const bool geni = line.rfind("GENI ", 0) == 0; if (!geni && line.rfind("GEN ", 0) != 0) { std::printf("ERR expected: GEN or GENI \n"); @@ -3976,6 +3977,7 @@ int main(int argc, char** argv) { int64_t at = read_from; for (const int64_t to : {reread_to, root_at, turn_at, n - 1}) { if (to <= at) continue; + err.clear(); const bool win = windows_ok(at, to); if (win && !refill(err)) { std::printf("ERR refilling a lent slot failed: %s\n", err.c_str());