Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make delimiter in rich progress bar configurable #18372

Merged
merged 8 commits into from
Aug 24, 2023
Prev Previous commit
Next Next commit
move space to joining delimiter
quintenroets committed Aug 22, 2023
commit 24fdfed90e789b07393fc6fe22ae590a726b1377
4 changes: 2 additions & 2 deletions src/lightning/pytorch/callbacks/progress/rich_progress.py
Original file line number Diff line number Diff line change
@@ -167,12 +167,12 @@ def render(self, task: "Task") -> Text:
if self._trainer.training and task.id != self._current_task_id:
return self._tasks[task.id]

text = "".join(self.generate_metrics_texts())
text = " ".join(self.generate_metrics_texts())
return Text(text, justify="left", style=self._style)

def generate_metrics_texts(self):
for k, v in self._metrics.items():
yield f"{k}: {round(v, 3) if isinstance(v, float) else v} "
yield f"{k}: {round(v, 3) if isinstance(v, float) else v}"

else:
Task, Style = Any, Any # type: ignore[assignment, misc]