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

Add better support for reporting training continuation values #917

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion docs/using-pretrained-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ experiment:
# Continue training a teacher model.
train-teacher:
urls:
- https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/task-id/artifacts/public/build
# Replace the following {task_id} with the "train-teacher" task id.
- https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/{task_id}/artifacts/public/build
mode: continue
type: default

Expand Down
9 changes: 8 additions & 1 deletion utils/trigger_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import argparse
import datetime
import json
from pathlib import Path
import subprocess
import sys
Expand Down Expand Up @@ -156,13 +157,19 @@ def log_config_info(config_path: Path, config: dict):
pretrained_models: Optional[dict] = experiment.get("pretrained-models")
if pretrained_models:
for key, value in pretrained_models.items():
config_details.append((key, value))
config_details.append((key, json.dumps(value, indent=2)))

key_len = 0
for key, _ in config_details:
key_len = max(key_len, len(key))

for key, value in config_details:
if "\n" in value:
# Nicely indent any multiline value.
padding = " " * (key_len + 6)
lines = [padding + n for n in value.split("\n")]
value = "\n".join(lines).strip() # noqa: PLW2901

print(f"{key.rjust(key_len + 4, " ")}: {value}")


Expand Down