Add error handling for non-llama.cpp models in portable mode

This commit is contained in:
oobabooga 2025-06-12 22:17:39 -07:00
parent a25a1fc8d0
commit f337767f36
2 changed files with 16 additions and 2 deletions

View file

@ -174,7 +174,12 @@ def create_event_handlers():
def load_model_wrapper(selected_model, loader, autoload=False):
settings = get_model_metadata(selected_model)
try:
settings = get_model_metadata(selected_model)
except FileNotFoundError:
exc = traceback.format_exc()
yield exc.replace('\n', '\n\n')
return
if not autoload:
yield "### {}\n\n- Settings updated: Click \"Load\" to load the model\n- Max sequence length: {}".format(selected_model, settings['truncation_length_info'])