Skip to content

Commit

Permalink
Add better support for reporting training continuation values (#917)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregtatum authored Jan 2, 2025
1 parent efc2289 commit 5dc7076
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
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 @@ -167,13 +168,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

0 comments on commit 5dc7076

Please sign in to comment.