huggingface_hub deprecate resume_download

This commit is contained in:
Qing
2024-11-23 20:14:28 +08:00
parent 341f610159
commit 683298dd5f
2 changed files with 3 additions and 6 deletions

View File

@@ -36,10 +36,7 @@ def cli_download_model(model: str):
from diffusers import DiffusionPipeline
downloaded_path = handle_from_pretrained_exceptions(
DiffusionPipeline.download,
pretrained_model_name=model,
variant="fp16",
resume_download=True,
DiffusionPipeline.download, pretrained_model_name=model, variant="fp16"
)
logger.info(f"Done. Downloaded to {downloaded_path}")

View File

@@ -79,6 +79,7 @@ class ControlNet(DiffusionInpaintModel):
from diffusers import (
StableDiffusionControlNetInpaintPipeline as PipeClass,
)
original_config_file_name = "v1"
elif model_info.model_type in [
@@ -88,11 +89,11 @@ class ControlNet(DiffusionInpaintModel):
from diffusers import (
StableDiffusionXLControlNetInpaintPipeline as PipeClass,
)
original_config_file_name = "xl"
controlnet = ControlNetModel.from_pretrained(
pretrained_model_name_or_path=controlnet_method,
resume_download=True,
local_files_only=model_kwargs["local_files_only"],
torch_dtype=self.torch_dtype,
)
@@ -139,7 +140,6 @@ class ControlNet(DiffusionInpaintModel):
self.controlnet_method = new_method
controlnet = ControlNetModel.from_pretrained(
new_method,
resume_download=True,
local_files_only=self.local_files_only,
torch_dtype=self.torch_dtype,
).to(self.model.device)