mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-10-01 01:26:03 -04:00
Better detect when no model is loaded
This commit is contained in:
parent
c8ad960018
commit
27f3a78834
@ -120,7 +120,7 @@ def extract_message_from_reply(reply, state):
|
||||
|
||||
def chatbot_wrapper(text, state, regenerate=False, _continue=False):
|
||||
|
||||
if shared.model_name == 'None':
|
||||
if shared.model_name == 'None' or shared.model is None:
|
||||
print("No model is loaded! Select one in the Model tab.")
|
||||
yield shared.history['visible']
|
||||
return
|
||||
@ -198,7 +198,7 @@ def chatbot_wrapper(text, state, regenerate=False, _continue=False):
|
||||
|
||||
def impersonate_wrapper(text, state):
|
||||
|
||||
if shared.model_name == 'None':
|
||||
if shared.model_name == 'None' or shared.model is None:
|
||||
print("No model is loaded! Select one in the Model tab.")
|
||||
yield ''
|
||||
return
|
||||
|
@ -125,7 +125,7 @@ def stop_everything_event():
|
||||
|
||||
def generate_reply(question, state, eos_token=None, stopping_strings=[]):
|
||||
|
||||
if shared.model_name == 'None':
|
||||
if shared.model_name == 'None' or shared.model is None:
|
||||
print("No model is loaded! Select one in the Model tab.")
|
||||
yield formatted_outputs(question, shared.model_name)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user