Skip to content

Conversation

@artek0chumak
Copy link
Contributor

Issue # MOSH-746

Describe your changes

This PR adds progress bar for the FT jobs.

@artek0chumak artek0chumak changed the title [WIP] Add progress bar Add progress bar for Fine-tuning jobs Dec 11, 2025
if use_rich:
return progress

return re.sub(r"\[/?[^\]]+\]", "", progress)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to produce desired output format directly to avoid regexs?

)
percentage = ratio_filled * 100
filled = math.ceil(ratio_filled * _PROGRESS_BAR_WIDTH)
bar = "█" * filled + "░" * (_PROGRESS_BAR_WIDTH - filled)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might there be off-the-shelf libs to use for this?


elapsed_time = (current_time - update_at).total_seconds()
ratio_filled = min(
elapsed_time / finetune_job.progress.seconds_remaining, 1.0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we get this progress from API?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed offline, we don't

response.events = None

click.echo(json.dumps(response.model_dump(exclude_none=True), indent=4))
rprint(JSON.from_data(response.model_dump(exclude_none=True)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we switch to rprint in spirit of depreciation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can, yes.

@artek0chumak artek0chumak marked this pull request as ready for review December 15, 2025 14:54
@artek0chumak artek0chumak merged commit 32fb539 into main Dec 15, 2025
11 checks passed
@artek0chumak artek0chumak deleted the artekchumak/add-progress-bar branch December 15, 2025 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants