Update app.py
Browse files
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)
|