mirror of
https://github.com/MLSysBook/TinyTorch.git
synced 2026-06-02 08:32:31 -05:00
- Replace complex setup module with simple hello_tinytorch() function - Keep only the ASCII art file (tinytorch_flame.txt) for visual appeal - Simplify tests to just verify function runs and file exists - Update README to reflect simplified purpose and usage - Remove complex developer profiles and system info classes - Focus on minimal introduction to TinyTorch workflow
53 lines
1.6 KiB
Python
53 lines
1.6 KiB
Python
# %% [markdown]
|
|
# # TinyTorch Setup Module
|
|
#
|
|
# Welcome to TinyTorch! This is your first module in the Machine Learning Systems course.
|
|
#
|
|
# This module simply displays our beautiful ASCII art to get you started.
|
|
|
|
# %%
|
|
import os
|
|
from pathlib import Path
|
|
|
|
def hello_tinytorch():
|
|
"""Display the TinyTorch ASCII art"""
|
|
try:
|
|
# Get the directory containing this file
|
|
current_dir = Path(__file__).parent
|
|
art_file = current_dir / "tinytorch_flame.txt"
|
|
|
|
if art_file.exists():
|
|
with open(art_file, 'r') as f:
|
|
ascii_art = f.read()
|
|
print(ascii_art)
|
|
print("Tiny🔥Torch")
|
|
print("Build ML Systems from Scratch!")
|
|
else:
|
|
print("🔥 TinyTorch 🔥")
|
|
print("Build ML Systems from Scratch!")
|
|
except NameError:
|
|
# Handle case when running in notebook where __file__ is not defined
|
|
try:
|
|
art_file = Path(os.getcwd()) / "tinytorch_flame.txt"
|
|
if art_file.exists():
|
|
with open(art_file, 'r') as f:
|
|
ascii_art = f.read()
|
|
print(ascii_art)
|
|
print("Tiny🔥Torch")
|
|
print("Build ML Systems from Scratch!")
|
|
else:
|
|
print("🔥 TinyTorch 🔥")
|
|
print("Build ML Systems from Scratch!")
|
|
except:
|
|
print("🔥 TinyTorch 🔥")
|
|
print("Build ML Systems from Scratch!")
|
|
|
|
# %% [markdown]
|
|
# ## Test the Setup
|
|
#
|
|
# Let's run our hello function to see the ASCII art:
|
|
|
|
# %%
|
|
if __name__ == "__main__":
|
|
hello_tinytorch()
|