huggingface_hub deprecate resume_download
This commit is contained in:
@@ -36,10 +36,7 @@ def cli_download_model(model: str):
|
|||||||
from diffusers import DiffusionPipeline
|
from diffusers import DiffusionPipeline
|
||||||
|
|
||||||
downloaded_path = handle_from_pretrained_exceptions(
|
downloaded_path = handle_from_pretrained_exceptions(
|
||||||
DiffusionPipeline.download,
|
DiffusionPipeline.download, pretrained_model_name=model, variant="fp16"
|
||||||
pretrained_model_name=model,
|
|
||||||
variant="fp16",
|
|
||||||
resume_download=True,
|
|
||||||
)
|
)
|
||||||
logger.info(f"Done. Downloaded to {downloaded_path}")
|
logger.info(f"Done. Downloaded to {downloaded_path}")
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ class ControlNet(DiffusionInpaintModel):
|
|||||||
from diffusers import (
|
from diffusers import (
|
||||||
StableDiffusionControlNetInpaintPipeline as PipeClass,
|
StableDiffusionControlNetInpaintPipeline as PipeClass,
|
||||||
)
|
)
|
||||||
|
|
||||||
original_config_file_name = "v1"
|
original_config_file_name = "v1"
|
||||||
|
|
||||||
elif model_info.model_type in [
|
elif model_info.model_type in [
|
||||||
@@ -88,11 +89,11 @@ class ControlNet(DiffusionInpaintModel):
|
|||||||
from diffusers import (
|
from diffusers import (
|
||||||
StableDiffusionXLControlNetInpaintPipeline as PipeClass,
|
StableDiffusionXLControlNetInpaintPipeline as PipeClass,
|
||||||
)
|
)
|
||||||
|
|
||||||
original_config_file_name = "xl"
|
original_config_file_name = "xl"
|
||||||
|
|
||||||
controlnet = ControlNetModel.from_pretrained(
|
controlnet = ControlNetModel.from_pretrained(
|
||||||
pretrained_model_name_or_path=controlnet_method,
|
pretrained_model_name_or_path=controlnet_method,
|
||||||
resume_download=True,
|
|
||||||
local_files_only=model_kwargs["local_files_only"],
|
local_files_only=model_kwargs["local_files_only"],
|
||||||
torch_dtype=self.torch_dtype,
|
torch_dtype=self.torch_dtype,
|
||||||
)
|
)
|
||||||
@@ -139,7 +140,6 @@ class ControlNet(DiffusionInpaintModel):
|
|||||||
self.controlnet_method = new_method
|
self.controlnet_method = new_method
|
||||||
controlnet = ControlNetModel.from_pretrained(
|
controlnet = ControlNetModel.from_pretrained(
|
||||||
new_method,
|
new_method,
|
||||||
resume_download=True,
|
|
||||||
local_files_only=self.local_files_only,
|
local_files_only=self.local_files_only,
|
||||||
torch_dtype=self.torch_dtype,
|
torch_dtype=self.torch_dtype,
|
||||||
).to(self.model.device)
|
).to(self.model.device)
|
||||||
|
|||||||
Reference in New Issue
Block a user