-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync_official.py
More file actions
44 lines (37 loc) · 1.05 KB
/
sync_official.py
File metadata and controls
44 lines (37 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
"""
synchronize with the official repo
"""
from pathlib import Path
project_dir = Path(__file__).resolve().parent
official_dir = {
"baseline": project_dir / "official_baseline",
"scoring": project_dir / "official_scoring_metric",
}
files = {
"baseline": [
"helper_code.py",
"remove_data.py",
"remove_labels.py",
"run_model.py",
"train_model.py",
"truncate_data.py",
],
"scoring": [
"evaluate_model.py",
],
}
def main():
updated = False
for repo, file_list in files.items():
for filename in file_list:
src = official_dir[repo] / filename
dst = project_dir / filename
if src.read_text() == dst.read_text():
continue
print(f"Copying **{src.relative_to(project_dir)}** " f"to **{dst.relative_to(project_dir)}**")
dst.write_text(src.read_text())
updated = True
if not updated:
print("Submodules of the official repositories are up-to-date.")
if __name__ == "__main__":
main()