diff --git a/modules/setup/setup_dev.py b/modules/setup/setup_dev.py index ee69f111..bf8bc2b9 100644 --- a/modules/setup/setup_dev.py +++ b/modules/setup/setup_dev.py @@ -204,6 +204,15 @@ class DeveloperProfile: Default to course instructor but allow students to personalize. """ + @staticmethod + def _load_default_flame(): + """ + Load the default TinyTorch flame ASCII art from file. + + TODO: Implement file loading for tinytorch_flame.txt with fallback. + """ + raise NotImplementedError("Student implementation required") + def __init__(self, name="Vijay Janapa Reddi", affiliation="Harvard University", email="vj@eecs.harvard.edu", github_username="profvjreddi", ascii_art=None): """ @@ -234,7 +243,7 @@ class DeveloperProfile: """ Get ASCII art for the profile. - TODO: Return custom ASCII art or default flame. + TODO: Return custom ASCII art or default flame loaded from file. """ raise NotImplementedError("Student implementation required") @@ -244,8 +253,27 @@ class DeveloperProfile: class DeveloperProfile: """Developer profile for personalizing TinyTorch experience.""" - # Default TinyTorch flame ASCII art - DEFAULT_FLAME = """ + @staticmethod + def _load_default_flame(): + """Load the default TinyTorch flame ASCII art from file.""" + try: + # Try to load from the same directory as this module + import os + current_dir = os.path.dirname(__file__) + flame_path = os.path.join(current_dir, 'tinytorch_flame.txt') + + with open(flame_path, 'r', encoding='utf-8') as f: + flame_art = f.read() + + # Add the Tiny🔥Torch text below the flame + return f"""{flame_art} + + Tiny🔥Torch + Build ML Systems from Scratch! + """ + except (FileNotFoundError, IOError): + # Fallback to simple flame if file not found + return """ 🔥 TinyTorch Developer 🔥 . . . . . . . . . . . . @@ -262,7 +290,7 @@ class DeveloperProfile: \\ \\ \\ \\ \\ \\ \\ / / / / / / \\ \\ \\ \\ \\ \\ / / / / / / \\ \\ \\ \\ \\ / / / / / / - \\ \\ \\ \\ / / / / / + \\ \\ \\ \\ / / / / / / \\ \\ \\ / / / / / / \\ \\ / / / / / / \\ / / / / / / @@ -272,7 +300,10 @@ class DeveloperProfile: \\/ / / \\/ / \\/ - """ + + Tiny🔥Torch + Build ML Systems from Scratch! + """ def __init__(self, name="Vijay Janapa Reddi", affiliation="Harvard University", email="vj@eecs.harvard.edu", github_username="profvjreddi", ascii_art=None): @@ -280,7 +311,7 @@ class DeveloperProfile: self.affiliation = affiliation self.email = email self.github_username = github_username - self.ascii_art = ascii_art or self.DEFAULT_FLAME + self.ascii_art = ascii_art or self._load_default_flame() def __str__(self): return f"👨‍💻 {self.name} | {self.affiliation} | @{self.github_username}" @@ -358,11 +389,30 @@ except NotImplementedError as e: 1. **Update your profile** in the cell above with your real information 2. **Create custom ASCII art** - your initials, a simple logo, or something that represents you -3. **Add your signature** to code you write throughout the course -4. **Show off your full profile** with the `get_full_profile()` method +3. **Customize the flame file** - edit `tinytorch_flame.txt` to create your own default art +4. **Add your signature** to code you write throughout the course +5. **Show off your full profile** with the `get_full_profile()` method This isn't just about customization - it's about taking ownership of your learning journey in ML systems! +**ASCII Art Customization Options:** + +**Option 1: Custom ASCII Art Parameter** +```python +my_profile = DeveloperProfile( + name="Your Name", + ascii_art=''' + Your Custom ASCII Art Here! + Maybe your initials, a logo, or something fun! + ''' +) +``` + +**Option 2: Edit the Default Flame File** +- Edit `tinytorch_flame.txt` in this directory +- Replace with your own ASCII art design +- All students using defaults will see your custom art! + **ASCII Art Ideas:** - Your initials in block letters - A simple logo or symbol that represents you @@ -379,6 +429,11 @@ This isn't just about customization - it's about taking ownership of your learni / \\|_|/ \\ ``` +**Pro Tip**: The `tinytorch_flame.txt` file contains the beautiful default flame art. You can: +- Edit it directly for a personalized default +- Create your own `.txt` file and modify the code to load it +- Use online ASCII art generators for inspiration + **Example personalized hello:** ```python def my_hello_tinytorch(): diff --git a/modules/setup/tests/test_setup.py b/modules/setup/tests/test_setup.py index df7b5fa5..68ba7520 100644 --- a/modules/setup/tests/test_setup.py +++ b/modules/setup/tests/test_setup.py @@ -188,8 +188,9 @@ class TestDeveloperProfile: ascii_art = profile.get_ascii_art() assert isinstance(ascii_art, str) - assert "🔥 TinyTorch Developer 🔥" in ascii_art - assert len(ascii_art) > 50 # Should be substantial ASCII art + assert "Tiny🔥Torch" in ascii_art + assert "Build ML Systems from Scratch!" in ascii_art + assert len(ascii_art) > 100 # Should be substantial ASCII art from file # Test custom ASCII art custom_art = "My Custom Art!" @@ -202,7 +203,8 @@ class TestDeveloperProfile: full_profile = profile.get_full_profile() assert isinstance(full_profile, str) - assert "🔥 TinyTorch Developer 🔥" in full_profile + assert "Tiny🔥Torch" in full_profile + assert "Build ML Systems from Scratch!" in full_profile assert "👨‍💻 Developer: Vijay Janapa Reddi" in full_profile assert "🏛️ Affiliation: Harvard University" in full_profile assert "📧 Email: vj@eecs.harvard.edu" in full_profile @@ -224,8 +226,9 @@ class TestDeveloperProfile: assert profile.affiliation == "Harvard University" assert profile.email == "vj@eecs.harvard.edu" - # Should still have default ASCII art - assert "🔥 TinyTorch Developer 🔥" in profile.get_ascii_art() + # Should still have default ASCII art from file + assert "Tiny🔥Torch" in profile.get_ascii_art() + assert "Build ML Systems from Scratch!" in profile.get_ascii_art() class TestModuleIntegration: diff --git a/modules/setup/tinytorch_flame.txt b/modules/setup/tinytorch_flame.txt new file mode 100644 index 00000000..e200993d --- /dev/null +++ b/modules/setup/tinytorch_flame.txt @@ -0,0 +1,25 @@ +. . ... ....... .... ... . . .. .... . .. . . . . . .... +. . .. .++. .. . . . .. ... . . . .. ... .. + . . . .=++=.. . . . .. . . .. . ... .. . . +. .. ... .++++=. . . . . .. . .. . +. . . . ....-+++++.... ... .. . .... .. . . . . . . . . . . . . + . .. ...-++++++-...... .. . ..... ..-:.. .. . .... .. . . .. . .. . . . + .. .. ..++++++++-.. . . ..##... -%#. . . . . . +. .. .:+++++++++.... ... . ...:%%:............:-:. ..... ...... . . ....... .. . . + ..+++++++++++. ... . .. .=#%%##+.-##..#%####%%=.=%%. .*%+.. . . . ... + . ..++++++++++++...-++..... . .%%... -##..##=...=%#..*%*..=%#.. . .. ... . . . . .. . ... + ..-+++++++++++++..=++++... .....%#.. -##..#%-.. -##. .%%=.%%.. . . . . . ... . +. .=++++++++++++++-+++++++.... . ...%%:...-##..#%-. .-%#. ..#%#%=.. . .. ... . . . . +..=+++++++++++++++++++++++-. . ..=%%%+.-%#..##-. .-%#....-%%*.. . .. . .. .. .. +.:+++++++++++=+++++++++++++. . ................ .......-%%... . .. . . .. . +.++++++++++===+++++++++++++: . .................... . ...%%%#:........ . .. ..... ......... .... +:+++++++++====+++++++++++++=.. ...-----------.....-+#*=:.....-------:.......:=*#+-.. ..--:.....--=. +:++++++++======++++++++++++=.. ...#%%%%%%%%%#..-#%%###%%#=...#%####%%%=...+%%%###%%#...#%+.. ..#%%. +.+++++++========+++++++++++- .. .#%%.. ..-%%+.. ..-%%+..#%*.. .*%%..*%%:. ..#%*..#%+... .#%%. +.=++++++==========+++++++++: . .#%%.....#%#.... .*%#..#%*...-%%*..#%+. ... . ..##%#####%%%. +..++++++===========+++++++-. . ...#%%. . .#%#. . .*%#..#%%%%%%#-. .#%+. . ....#%*-----#%%. +...+++++===========++++++=. . . . .#%%... -%%+.....=%%+..#%*..+%%-. .*%%-.....#%*..%%+.. ..%%%. +. ..-+++===========+++++.. . .. ..#%%. .:%%%###%%%=...#%*...+%%=...+%%####%%#...%%+.. ..%%%. + . ...-++==========+++:.... ... . .===. ... ..-+++=.. ..-=-....-==: ..:=+++-.. ..==-... .===. + ....-+=======+-...... .. . . ... . . .. ... . . .... . . . . ..... . ... ..... . + .... . ......:..... ... . .. . ... . . ... . . . ... . . . ... .. ..... . .