Repository navigation
Conversation
…e log in finetune_csv - webui/app.py: last_pred/first_actual continuity analysis block was incorrectly indented outside the "if len(prediction_results) > 0" check, causing a NameError (silently swallowed by the outer try/except) whenever actual_data was present but prediction_results was empty. Nest the block correctly so it only runs when both last_pred and first_actual are defined. - finetune_csv/finetune_tokenizer.py: "Total Training Time" was computed from epoch_start_time (reset every epoch), so it always equaled "Epoch Time". Added a start_time captured once before the epoch loop and use it for the total-time log, matching the pattern already used in finetune/train_tokenizer.py. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kossto82-ops
added a commit
to kossto82-ops/Kronos
that referenced
this pull request
Oct 12, 2026
…nce panel - model: explicit eval() in KronosPredictor, greedy decoding for T<=0 - app: input validation in /api/predict, robust load_data_file (case-insensitive columns, sort/dedupe timestamps, synthetic-date flag), fix UnboundLocalError in save_prediction_results (upstream shiyu-coder#402) - app: walk-forward self-evaluation endpoints (/api/evaluate, status, cache) with verdict (good/medium/bad) vs no-op baseline, confidence in /api/predict - ui: confidence panel with traffic light and warning under prediction summary, T=0 deterministic option, sampling params shown in summary badge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Two small but real bugs turned up during a code review pass over
model/,webui/, andfinetune*/:webui/app.py: Insave_prediction_results, the continuity-analysis block (which computeslast_prediction,first_actual, gaps, and gap percentages) was indented one level too shallow.first_actualand thesave_data['analysis']['continuity']assignment sat outside theif len(prediction_results) > 0 and len(actual_data) > 0guard, even though they referencelast_pred, which is only defined inside that guard. Wheneveractual_datawas present butprediction_resultswas empty, this raised aNameError. Because the whole function body is wrapped in a broadtry/except, the error was swallowed silently and prediction results simply failed to save, with only a generic log message.finetune_csv/finetune_tokenizer.py: The end-of-epoch summary logs both "Epoch Time" and "Total Training Time", but both were computed from the sameepoch_start_time, which is reset at the top of every epoch loop iteration. As a result, "Total Training Time" always equaled "Epoch Time" instead of accumulating across the whole run, making the logged totals misleading. The sibling scriptfinetune/train_tokenizer.pydoes this correctly by tracking a separatestart_timecaptured once before the epoch loop; this change bringsfinetune_csv/finetune_tokenizer.pyin line with that pattern.What changed
webui/app.py: Re-nestedfirst_actualand thecontinuitydict assignment inside theif len(prediction_results) > 0 and len(actual_data) > 0block solast_pred/first_actualare always defined before use. No behavioral change to the analysis logic itself, just the control flow.finetune_csv/finetune_tokenizer.py: Addedstart_time = time.time()once before the epoch loop intrain_tokenizer, and changed the "Total Training Time" log line to usestart_timeinstead ofepoch_start_time.Verification
python3 -m py_compile.save_prediction_resultswith stubbed dependencies for both the previously-crashing case (emptyprediction_resultswith non-emptyactual_data) and the normal case (both present), confirming noNameErrorand correctgap_percentagesoutput.