Skip to content

fix(finetune): make Comet logging optional - #390

Open
MohammadWasi wants to merge 1 commit into
shiyu-coder:masterfrom
MohammadWasi:fix/optional-comet-logging
Open

fix(finetune): make Comet logging optional#390
MohammadWasi wants to merge 1 commit into
shiyu-coder:masterfrom
MohammadWasi:fix/optional-comet-logging

Conversation

@MohammadWasi

@MohammadWasi MohammadWasi commented Aug 13, 2026

Copy link
Copy Markdown

Summary

  • make Comet ML an optional dependency for the Qlib fine-tuning workflow
  • disable Comet logging by default because the checked-in configuration contains placeholder credentials
  • keep the existing Comet behavior unchanged when use_comet is explicitly enabled

Problem

Both finetune/train_tokenizer.py and finetune/train_predictor.py imported comet_ml unconditionally. As a result, a user who follows the documented no-Comet path (use_comet = False) still fails before training starts unless Comet is installed.

Implementation

  • add finetune/utils/experiment_logging.py to lazily create a Comet experiment only when enabled
  • provide an actionable error when logging is enabled but comet_ml is missing
  • reuse the helper from both fine-tuning entry points
  • document how to opt in to Comet logging

Tests

  • python -m unittest tests/test_experiment_logging.py
  • python -m py_compile finetune/config.py finetune/train_tokenizer.py finetune/train_predictor.py finetune/utils/experiment_logging.py
  • git diff --check

The new tests verify that disabled logging does not import Comet, enabled logging explains a missing dependency, and valid Comet configuration creates and configures the experiment.

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.

1 participant