Skip to content

Conversation

@PouyaGhahramanian
Copy link

What

Adds an optional tqdm progress bar around the train & validation loops in TimesFMFinetuner.

Why

Long fine-tuning jobs provide no per-batch feedback right now. Progress bars improve UX without changing training logic.

How

  • FinetuningConfig now includes progress_bar: bool = True.
  • Wrap the DataLoader iterators in _train_epoch/_validate with tqdm when config.progress_bar and rank == 0.
  • Display running average loss every log_every_n_steps via set_postfix.

Backward compatibility

Setting progress_bar=False disables the bars; otherwise only stdout changes.

Closes #289.

@google-cla
Copy link

google-cla bot commented Jul 27, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@LydiaCai1203
Copy link

@MonkeyCode-AI review

Copy link

@MonkeyCode-AI MonkeyCode-AI left a comment

Choose a reason for hiding this comment

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

Pull Request 概述

该PR对TimesFM的PyTorch微调实现进行了多项改进,增强了训练过程的功能性和用户体验。主要变更包括:

  1. 添加了tqdm进度条支持,提升了训练和验证过程的可视化
  2. 实现了模型检查点保存功能(最佳模型、每个epoch模型、最后模型)
  3. 简化了部分文档字符串
  4. 添加了新的配置选项用于控制检查点保存行为

Pull Request 变更详情

文件路径 变更类型 变更内容
src/finetuning/finetuning_torch.py 修改 添加了进度条支持、模型检查点保存功能、改进了训练循环和日志记录
.gitignore 修改 添加了._*忽略模式

评审意见

  1. 虽然简化文档字符串可以减少冗余,但建议至少保留关键的参数和返回值说明,以提高代码可维护性
  2. 新增的配置选项(如检查点相关参数)应该在类的文档字符串中进行说明
  3. 在修改方法签名(如_validate方法添加epoch参数)后,应相应地更新文档字符串

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.

Add tqdm progress bars to TimesFMFinetuner (finetuning_torch.py)

3 participants