Add a warning for when no model is loaded

This commit is contained in:
oobabooga 2023-04-13 10:35:08 -03:00
parent ddbd237ec9
commit 04866dc4fc
2 changed files with 16 additions and 0 deletions

View file

@ -124,6 +124,12 @@ def stop_everything_event():
def generate_reply(question, state, eos_token=None, stopping_strings=[]):
if shared.model_name == 'None':
print("No model is loaded! Select one in the Model tab.")
yield formatted_outputs(question, shared.model_name)
return
clear_torch_cache()
seed = set_manual_seed(state['seed'])
shared.stop_everything = False