mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-29 10:59:32 +01:00
If only 1 model is available, load that model
This commit is contained in:
parent
8b482b4127
commit
fbb448ce4f
17
server.py
17
server.py
@ -441,16 +441,19 @@ else:
|
||||
if extension not in shared.args.extensions:
|
||||
shared.args.extensions.append(extension)
|
||||
|
||||
# Default model
|
||||
# Model defined through --model
|
||||
if shared.args.model is not None:
|
||||
shared.model_name = shared.args.model
|
||||
shared.model, shared.tokenizer = load_model(shared.model_name)
|
||||
|
||||
# Only one model is available
|
||||
elif len(available_models) == 1:
|
||||
shared.model_name = available_models[0]
|
||||
|
||||
# Select the model from a command-line menu
|
||||
elif shared.args.model_menu:
|
||||
if len(available_models) == 0:
|
||||
print('No models are available! Please download at least one.')
|
||||
sys.exit(0)
|
||||
elif len(available_models) == 1:
|
||||
i = 0
|
||||
else:
|
||||
print('The following models are available:\n')
|
||||
for i, model in enumerate(available_models):
|
||||
@ -459,9 +462,11 @@ elif shared.args.model_menu:
|
||||
i = int(input()) - 1
|
||||
print()
|
||||
shared.model_name = available_models[i]
|
||||
shared.model, shared.tokenizer = load_model(shared.model_name)
|
||||
|
||||
if shared.args.model is not None and shared.args.lora:
|
||||
# If any model has been selected, load it
|
||||
if shared.model_name != 'None':
|
||||
shared.model, shared.tokenizer = load_model(shared.model_name)
|
||||
if shared.args.lora:
|
||||
add_lora_to_model(shared.args.lora)
|
||||
|
||||
# Default UI settings
|
||||
|
Loading…
Reference in New Issue
Block a user