let exllama v1 models load safetensor loras (#4854)

This commit is contained in:
luna 2023-12-20 13:29:19 -03:00 committed by GitHub
parent bcba200790
commit 6efbe3009f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,7 +53,10 @@ def add_lora_exllama(lora_names):
lora_path = get_lora_path(lora_names[0]) lora_path = get_lora_path(lora_names[0])
lora_config_path = lora_path / "adapter_config.json" lora_config_path = lora_path / "adapter_config.json"
lora_adapter_path = lora_path / "adapter_model.bin" for file_name in ["adapter_model.safetensors", "adapter_model.bin"]:
file_path = lora_path / file_name
if file_path.is_file():
lora_adapter_path = file_path
logger.info("Applying the following LoRAs to {}: {}".format(shared.model_name, ', '.join([lora_names[0]]))) logger.info("Applying the following LoRAs to {}: {}".format(shared.model_name, ', '.join([lora_names[0]])))
if shared.model.__class__.__name__ == 'ExllamaModel': if shared.model.__class__.__name__ == 'ExllamaModel':