-
Notifications
You must be signed in to change notification settings - Fork 28
Add cli val loss graph #735
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds a new CLI tool to visualize bulk CSV training logs (train/val loss) in a live-updating, TensorBoard-like interface, and documents how to use it.
Changes:
- Added
logging/view_csv_logs.pyto render live train/val loss charts frombulk_*.csvlogs (terminal UI viarich, optional matplotlib mode). - Updated
README.mdwith usage instructions and CLI options for the new viewer.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| logging/view_csv_logs.py | New live CSV log viewer (ASCII/terminal rendering + optional matplotlib rendering). |
| README.md | Documents how to run the new viewer and describes key options. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def load_csv_series(path: str, x_col_index: int, max_points: int) -> CsvSeries: | ||
| x_values: list[float] = [] | ||
| train_values: list[float] = [] | ||
| val_values: list[float] = [] | ||
| with open(path, newline="") as handle: | ||
| reader = csv.reader(handle) | ||
| for row in reader: |
Copilot
AI
Feb 1, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
load_csv_series opens files without handling FileNotFoundError/OSError. In live mode, a file can disappear or be rotated between glob() and open(), which will crash the whole UI. Consider catching these exceptions and returning an empty CsvSeries (or skipping the file) so the viewer stays up.
| console = Console() | ||
| use_matplotlib = args.mode == "matplotlib" | ||
| if use_matplotlib: | ||
| import matplotlib.pyplot as plt |
Copilot
AI
Feb 1, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When --mode matplotlib is selected and matplotlib isn't installed, the script will raise an ImportError with a stack trace. Since matplotlib isn't listed in the main install command in the README, consider catching the import error and emitting a clear message like "Install matplotlib to use --mode matplotlib" (and exit with a non-zero code).
| import matplotlib.pyplot as plt | |
| try: | |
| import matplotlib.pyplot as plt | |
| except ImportError: | |
| console.print( | |
| "[bold red]Install matplotlib to use --mode matplotlib[/bold red]" | |
| ) | |
| raise SystemExit(1) |
| seconds, and can be switched to a tokens X-axis with `--x-axis tokens`. Use | ||
| `--layout horizontal` to place the legend beside the graph, or set the chart | ||
| height with `--height`. Use `--max-x` to control the X-axis scale (default 3000 | ||
| iters/tokens). For a matplotlib window, add `--mode matplotlib`. |
Copilot
AI
Feb 1, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section suggests using --mode matplotlib, but the README installation instructions don’t include matplotlib and the script will fail without it. Please add a brief note that matplotlib is an optional dependency (e.g., install via pip install matplotlib) when using that mode.
| iters/tokens). For a matplotlib window, add `--mode matplotlib`. | |
| iters/tokens). For a matplotlib window, add `--mode matplotlib`. This mode | |
| requires the optional `matplotlib` dependency (for example, install via | |
| `pip install matplotlib`). |
| break | ||
| time.sleep(args.refresh_seconds) | ||
| except KeyboardInterrupt: | ||
| pass |
Copilot
AI
Feb 1, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'except' clause does nothing but pass and there is no explanatory comment.
| pass | |
| # Allow user to exit with Ctrl-C without showing a traceback. | |
| return |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This pull request adds new documentation to the
README.mddescribing how to view CSV logs in a live, tensorboard-like interface. The update provides instructions and usage details for the newlogging/view_csv_logs.pyscript, including its options for customizing the display and behavior.Documentation improvements:
README.mdexplaining how to use theview_csv_logs.pyscript to visualize bulk CSV logs in a live-updating, tensorboard-style chart, including command-line options for customization.