gokaygokay commited on
Commit
e771e55
1 Parent(s): 13446b7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -6,8 +6,15 @@ from aura_sr import AuraSR
6
  import torch
7
  import spaces
8
 
 
 
 
 
 
 
 
9
  # Initialize the AuraSR model
10
- aura_sr = AuraSR.from_pretrained("fal-ai/AuraSR", map_location=torch.device('cpu'))
11
 
12
  # Move the model to CUDA if available, otherwise keep it on CPU
13
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
 
6
  import torch
7
  import spaces
8
 
9
+ # Force CPU usage
10
+ torch.set_default_tensor_type(torch.FloatTensor)
11
+
12
+ # Override torch.load to always use CPU
13
+ original_load = torch.load
14
+ torch.load = lambda *args, **kwargs: original_load(*args, **kwargs, map_location=torch.device('cpu'))
15
+
16
  # Initialize the AuraSR model
17
+ aura_sr = AuraSR.from_pretrained("fal-ai/AuraSR")
18
 
19
  # Move the model to CUDA if available, otherwise keep it on CPU
20
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")