Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -164,7 +164,7 @@ def main():
|
|
164 |
global step
|
165 |
global dtype
|
166 |
|
167 |
-
device = "
|
168 |
dtype = torch.float16
|
169 |
result=[]
|
170 |
step = 2
|
@@ -182,7 +182,7 @@ def main():
|
|
182 |
adapter = MotionAdapter().to(device, dtype)
|
183 |
adapter.load_state_dict(load_file(hf_hub_download(repo ,ckpt), device=device))
|
184 |
|
185 |
-
pipe = AnimateDiffPipeline.from_pretrained(base, motion_adapter=adapter, unet=unet, torch_dtype=dtype, variant="fp16"
|
186 |
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing", beta_schedule="linear")
|
187 |
|
188 |
mp.set_start_method("spawn", force=True)
|
|
|
164 |
global step
|
165 |
global dtype
|
166 |
|
167 |
+
device = "auto"
|
168 |
dtype = torch.float16
|
169 |
result=[]
|
170 |
step = 2
|
|
|
182 |
adapter = MotionAdapter().to(device, dtype)
|
183 |
adapter.load_state_dict(load_file(hf_hub_download(repo ,ckpt), device=device))
|
184 |
|
185 |
+
pipe = AnimateDiffPipeline.from_pretrained(base, motion_adapter=adapter, unet=unet, torch_dtype=dtype, variant="fp16", device_map=device)
|
186 |
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing", beta_schedule="linear")
|
187 |
|
188 |
mp.set_start_method("spawn", force=True)
|