Load local hugging face packages for assistant adapter

This commit is contained in:
Jaret Burkett
2024-09-23 10:37:12 -06:00
parent 2776221497
commit 40a8ff5731

View File

@@ -504,8 +504,11 @@ class StableDiffusion:
if not self.is_flux:
raise ValueError("Assistant lora is only supported for flux models currently")
# handle downloading from the hub if needed
if not os.path.exists(self.model_config.assistant_lora_path):
if os.path.isdir(self.model_config.assistant_lora_path):
self.model_config.assistant_lora_path = os.path.join(
self.model_config.assistant_lora_path, "pytorch_lora_weights.safetensors"
)
elif not os.path.exists(self.model_config.assistant_lora_path):
print(f"Grabbing assistant lora from the hub: {self.model_config.assistant_lora_path}")
new_lora_path = hf_hub_download(
self.model_config.assistant_lora_path,