Don't load the model twice when using --lora

This commit is contained in:
oobabooga 2023-03-24 16:30:32 -03:00 committed by GitHub
parent fd99995b01
commit d8e950d6bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -233,9 +233,7 @@ else:
shared.model_name = available_models[i]
shared.model, shared.tokenizer = load_model(shared.model_name)
if shared.args.lora:
print(shared.args.lora)
shared.lora_name = shared.args.lora
add_lora_to_model(shared.lora_name)
add_lora_to_model(shared.args.lora)
# Default UI settings
default_preset = shared.settings['presets'][next((k for k in shared.settings['presets'] if re.match(k.lower(), shared.model_name.lower())), 'default')]