Spaces:
Runtime error
Runtime error
Commit
·
ef2044c
1
Parent(s):
cfbf9d9
Update utils.py
Browse files
utils.py
CHANGED
|
@@ -54,10 +54,11 @@ def sample_frame(model: LatentDiffusion, prompt: str, image_sequence: torch.Tens
|
|
| 54 |
return x_samples_ddim.squeeze(0).cpu().numpy()
|
| 55 |
|
| 56 |
# Global variables for model and device
|
| 57 |
-
model = None
|
| 58 |
-
device = None
|
| 59 |
|
| 60 |
def initialize_model(config_path, model_name):
|
| 61 |
-
global model, device
|
| 62 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 63 |
-
model = load_model_from_config(config_path, model_name, device)
|
|
|
|
|
|
| 54 |
return x_samples_ddim.squeeze(0).cpu().numpy()
|
| 55 |
|
| 56 |
# Global variables for model and device
|
| 57 |
+
#model = None
|
| 58 |
+
#device = None
|
| 59 |
|
| 60 |
def initialize_model(config_path, model_name):
|
| 61 |
+
#global model, device
|
| 62 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 63 |
+
model = load_model_from_config(config_path, model_name, device)
|
| 64 |
+
return model
|