fix: Reset task timer when calling progress.reset() #3711
+225
−0
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.
Type of changes
Checklist
Description
This PR fixes an issue where restarting progress bar tasks did not reset their running clocks, causing the elapsed time to continue from its previous state.
Problem
When using
progress.reset()
to restart a task, the elapsed time would not reset properly. This was particularly noticeable in scenarios with multiple progress bars (like AI training with epochs, training, and validation phases) where tasks needed to be reset between iterations.Solution
The fix ensures that
stop_time
is cleared when a task is reset, allowing the elapsed time to be calculated correctly from the new start time.Changes
task.stop_time = None
in thereset()
method to clear the stop timeFixes bug #3273