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

use flag to disable wandb from CLI #56

Merged
merged 1 commit into from
May 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ def train(run_folder: str, output_dir: str):
print(f"Starting training run in {run_folder}.")
print(f"Using {torch.cuda.device_count()} {torch.cuda.get_device_name()} GPU(s).")

run_cmd("accelerate launch -m axolotl.cli.train ./config.yml", run_folder)
ALLOW_WANDB = os.environ.get("ALLOW_WANDB", "false").lower() == "true"
cmd = f"accelerate launch -m axolotl.cli.train ./config.yml {'--wandb_mode disabled' if not ALLOW_WANDB else ''}"
run_cmd(cmd, run_folder)

# Kick off CPU job to merge the LoRA weights into base model.
merge_handle = merge.spawn(run_folder, output_dir)
Expand Down
Loading