pytorch-labs / gpt-fast

Simple and efficient pytorch-native transformer text generation in <1000 LOC of python.
BSD 3-Clause "New" or "Revised" License
5.57k stars 507 forks source link

Set device to CPU if CUDA not available in some arguments #132

Closed cpuhrsch closed 6 months ago

cpuhrsch commented 6 months ago

There's more places this could be applied to

I tried the basic instructions on an x86 Mac for fun and noticed that without these changes the scripts will crash with AssertionError: Torch not compiled with CUDA enabled