mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-03-09 07:15:51 -05:00
Fixes encoding issues on Windows where emoji/unicode output would fail. Thanks @lalalostcode for reporting! See: https://github.com/harvard-edge/cs249r_book/discussions/1145
33 lines
824 B
Python
Executable File
33 lines
824 B
Python
Executable File
#!/usr/bin/env python3
|
|
"""
|
|
TinyTorch CLI wrapper - runs tito without requiring pip install.
|
|
|
|
Usage:
|
|
./bin/tito <command> [options]
|
|
|
|
Example:
|
|
./bin/tito dev preflight --ci
|
|
"""
|
|
import os
|
|
import sys
|
|
|
|
# Fix encoding issues on Windows (emoji/unicode output)
|
|
# See: https://github.com/harvard-edge/cs249r_book/discussions/1145
|
|
if sys.platform == "win32" or os.name == "nt":
|
|
os.environ.setdefault("PYTHONIOENCODING", "utf-8")
|
|
|
|
# Determine tinytorch root from this script's location
|
|
tinytorch_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
# Add to Python path so imports work
|
|
sys.path.insert(0, tinytorch_root)
|
|
|
|
# Change to tinytorch directory so Path.cwd() works correctly
|
|
os.chdir(tinytorch_root)
|
|
|
|
# Import and run main
|
|
from tito.main import main
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|