alessandro trinca tornidor commited on
Commit
9c92cc9
·
1 Parent(s): 56502bc

bug: handle PermissionError while get_model() execution

Browse files
Files changed (1) hide show
  1. lisa_on_cuda/utils/app_helpers.py +7 -2
lisa_on_cuda/utils/app_helpers.py CHANGED
@@ -121,8 +121,13 @@ def preprocess(
121
 
122
  @session_logger.set_uuid_logging
123
  def get_model(args_to_parse):
124
- logging.info("starting model preparation...")
125
- os.makedirs(args_to_parse.vis_save_path, exist_ok=True)
 
 
 
 
 
126
 
127
  # global tokenizer, tokenizer
128
  # Create model
 
121
 
122
  @session_logger.set_uuid_logging
123
  def get_model(args_to_parse):
124
+ logging.info(f"starting model preparation: {args_to_parse.vis_save_path}.")
125
+ try:
126
+ vis_save_path_exists = os.path.isdir(args_to_parse.vis_save_path)
127
+ logging.info(f"vis_save_path_exists:{vis_save_path_exists}.")
128
+ os.makedirs(args_to_parse.vis_save_path, exist_ok=True)
129
+ except PermissionError as pex:
130
+ logging.info(f"PermissionError: {pex}, folder:{args_to_parse.vis_save_path}.")
131
 
132
  # global tokenizer, tokenizer
133
  # Create model