-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate_screenshots.py
More file actions
68 lines (55 loc) · 1.94 KB
/
Copy pathgenerate_screenshots.py
File metadata and controls
68 lines (55 loc) · 1.94 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env python3
"""
Generate screenshots/visualizations for the project report.
USAGE:
python3 generate_screenshots.py
This script collects all PNG visualizations from part_X/out/ directories
and copies them to the screenshots/ folder for easy access.
TO GENERATE NEW VISUALIZATIONS:
cd part_1 && python3 demo_visualize_multi_head.py && cd ..
cd part_2 && python3 orchestrator.py && cd ..
cd part_5 && python3 demo_moe.py && cd ..
Then run this script to collect them all.
"""
import os
import sys
import shutil
from pathlib import Path
def collect_existing_images():
"""Collect all existing images from part_X/out/ directories."""
screenshots_dir = Path("screenshots")
screenshots_dir.mkdir(exist_ok=True)
print("Collecting existing visualizations...")
count = 0
for i in range(1, 10):
out_dir = Path(f"part_{i}/out")
if out_dir.exists():
for img in out_dir.glob("*.png"):
dest = screenshots_dir / f"{i:02d}_{img.name}"
shutil.copy2(img, dest)
print(f" ✓ {img.relative_to('.')}")
count += 1
return count
def main():
print("=" * 60)
print("SCREENSHOT COLLECTION FOR LLM FROM SCRATCH")
print("=" * 60)
print()
# Collect existing images
count = collect_existing_images()
print()
print("=" * 60)
if count > 0:
print(f"✓ Collected {count} visualization(s) to screenshots/")
print("\nView them:")
print(" ls screenshots/")
else:
print("No visualizations found.")
print("\nTo generate visualizations, run demos in each part:")
print(" cd part_1 && python3 demo_visualize_multi_head.py")
print(" cd part_2 && python3 orchestrator.py")
print(" cd part_5 && python3 demo_moe.py")
print("\nThen run this script again to collect them.")
print("=" * 60)
if __name__ == "__main__":
main()