Better detect when no model is loaded

This commit is contained in:
oobabooga 2023-04-16 17:35:54 -03:00
parent c8ad960018
commit 27f3a78834
2 changed files with 3 additions and 3 deletions

View file

@ -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