manbeast3b commited on
Commit
d63ace5
·
verified ·
1 Parent(s): 14af353

Update src/pipeline.py

Browse files
Files changed (1) hide show
  1. src/pipeline.py +2 -2
src/pipeline.py CHANGED
@@ -29,13 +29,13 @@ def load_pipeline() -> Pipeline:
29
  dtype, device = torch.bfloat16, "cuda"
30
  vae = AutoencoderKL.from_pretrained(
31
  ckpt_id, subfolder="vae", torch_dtype=torch.bfloat16
32
- )
33
  # quantize_(vae, int8_weight_only())
34
  pipeline = DiffusionPipeline.from_pretrained(
35
  ckpt_id,
36
  vae=vae,
37
  torch_dtype=dtype,
38
- )
39
  for name, module in pipeline.transformer.named_modules():
40
  if isinstance(module, torch.nn.Linear):
41
  prune.l1_unstructured(module, 'weight', amount=0.2)
 
29
  dtype, device = torch.bfloat16, "cuda"
30
  vae = AutoencoderKL.from_pretrained(
31
  ckpt_id, subfolder="vae", torch_dtype=torch.bfloat16
32
+ ).to(device)
33
  # quantize_(vae, int8_weight_only())
34
  pipeline = DiffusionPipeline.from_pretrained(
35
  ckpt_id,
36
  vae=vae,
37
  torch_dtype=dtype,
38
+ ).to(device)
39
  for name, module in pipeline.transformer.named_modules():
40
  if isinstance(module, torch.nn.Linear):
41
  prune.l1_unstructured(module, 'weight', amount=0.2)