in docker_images/diffusers/app/lora.py [0:0]
def _get_lora_weight_name(model_data):
weight_name_candidate = LoRAPipelineMixin._lora_weights_candidates(model_data)
if weight_name_candidate:
return weight_name_candidate
file_to_load = next(
(
file.rfilename
for file in model_data.siblings
if file.rfilename.endswith(".safetensors")
),
None,
)
if not file_to_load and not weight_name_candidate:
raise ValueError("No *.safetensors file found for your LoRA")
return file_to_load