Cleanup: set shared.model_name only once

This commit is contained in:
oobabooga 2023-12-08 06:35:23 -08:00
parent 62d59a516f
commit 2a335b8aa7
4 changed files with 3 additions and 5 deletions

View file

@ -203,10 +203,9 @@ def load_model_wrapper(selected_model, loader, autoload=False):
else:
try:
yield f"Loading `{selected_model}`..."
shared.model_name = selected_model
unload_model()
if selected_model != '':
shared.model, shared.tokenizer = load_model(shared.model_name, loader)
shared.model, shared.tokenizer = load_model(selected_model, loader)
if shared.model is not None:
output = f"Successfully loaded `{selected_model}`."