chunk_content:  base model name or path")
  
      pipe = StableDiffusionPipeline.from_pretrained(base_model_name_or_path, torch_dtype=dtype).to(device)
      pipe.unet = PeftModel.from_pretrained(pipe.unet, unet_sub_dir, adapter_name=adapter_name)
  
      if os.path.exists(text_encoder_sub_dir):
          pipe.text_encoder = PeftModel.from_pretrained(
              pipe.text_encoder, text_encoder_sub_dir, adapter_name=adapter_name
          )
  
      if dtype in (torch.float1