Add --panic to raise when loading fails

This commit is contained in:
somebody
2023-07-08 14:04:46 -05:00
parent fd6f66a98d
commit c2ee30af32
3 changed files with 8 additions and 0 deletions

View File

@@ -90,6 +90,8 @@ class model_backend(HFTorchInferenceModel):
utils.module_names = list(metamodel.state_dict().keys())
utils.named_buffers = list(metamodel.named_buffers(recurse=True))
except Exception as e:
if utils.args.panic:
raise e
logger.warning(f"Gave up on lazy loading due to {e}")
self.lazy_load = False