preamble
Fri Nov 17 2023 03:12:19 GMT+0000 (Coordinated Universal Time)
Saved by
@mikeee
%env PIP_ROOT_USER_ACTION=ignore
import os, time, torch, warnings
try:
from rich import print
except ModuleNotFoundError:
!pip install -q rich
from rich import print
if torch.cuda.is_available():
print(f"[green bold]\t{torch.cuda.is_available()=}")
else:
print(f"[red bold]\t{torch.cuda.is_available()=}")
os.environ["TZ"] = "Asia/Shanghai"
try:
time.tzset()
except AttributeError:
... # Windows
try:
from python_run_cmd import run_cmd
except ModuleNotFoundError:
!pip install -q python-run-cmd watermark rich
from python_run_cmd import run_cmd
%reload_ext watermark
warnings.filterwarnings("ignore")
content_copyCOPY
Comments