yuntian-deng commited on
Commit
ef2044c
·
1 Parent(s): cfbf9d9

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +5 -4
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