nyanko7 commited on
Commit
809bf96
1 Parent(s): 0c215fa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -751,6 +751,9 @@ model_zero_init = False
751
 
752
  @spaces.GPU()
753
  def apply_nf4_storage():
 
 
 
754
  global model, model_zero_init
755
  if not model_zero_init:
756
  model = model.to(torch_device)
 
751
 
752
  @spaces.GPU()
753
  def apply_nf4_storage():
754
+ device = "cuda" if torch.cuda.is_available() else "cpu"
755
+ torch_device = torch.device(device)
756
+
757
  global model, model_zero_init
758
  if not model_zero_init:
759
  model = model.to(torch_device)