cocktailpeanut commited on
Commit
84677d0
·
1 Parent(s): ed89148
Files changed (1) hide show
  1. gradio_demo/app.py +4 -4
gradio_demo/app.py CHANGED
@@ -126,9 +126,9 @@ def instantir_restore(
126
  print("Loading checkpoint...")
127
  aggregator_state_dict = torch.load(
128
  f"{instantir_path}/aggregator.pt",
129
- map_location = device
130
  # map_location = device if not cpu_offload else "cpu"
131
- # map_location="cpu"
132
  )
133
  pipe.aggregator.load_state_dict(aggregator_state_dict, strict=True)
134
  if not cpu_offload:
@@ -167,9 +167,9 @@ def instantir_restore(
167
  lq = [resize_img(lq.convert("RGB"), size=None)]
168
 
169
  if cpu_offload:
170
- generator = torch.Generator(device=device).manual_seed(seed)
171
- else:
172
  generator = torch.Generator().manual_seed(seed)
 
 
173
  timesteps = [
174
  i * (1000//steps) + pipe.scheduler.config.steps_offset for i in range(0, steps)
175
  ]
 
126
  print("Loading checkpoint...")
127
  aggregator_state_dict = torch.load(
128
  f"{instantir_path}/aggregator.pt",
129
+ # map_location = device
130
  # map_location = device if not cpu_offload else "cpu"
131
+ map_location="cpu"
132
  )
133
  pipe.aggregator.load_state_dict(aggregator_state_dict, strict=True)
134
  if not cpu_offload:
 
167
  lq = [resize_img(lq.convert("RGB"), size=None)]
168
 
169
  if cpu_offload:
 
 
170
  generator = torch.Generator().manual_seed(seed)
171
+ else:
172
+ generator = torch.Generator(device=device).manual_seed(seed)
173
  timesteps = [
174
  i * (1000//steps) + pipe.scheduler.config.steps_offset for i in range(0, steps)
175
  ]