Skip to content

Commit 82f096a

Browse files
Fix handling of model_dir in launch.py (#639)
1 parent b74c4ea commit 82f096a

File tree

1 file changed

+6
-3
lines changed
  • tracdap-runtime/python/src/tracdap/rt/launch

1 file changed

+6
-3
lines changed

tracdap-runtime/python/src/tracdap/rt/launch/launch.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def _resolve_config_file(
7373
return parent_config_path
7474

7575
if model_dir is not None:
76-
model_config_path = _search_parent_paths(cwd, config_path)
76+
model_config_path = _search_parent_paths(model_dir, config_path)
7777
if model_config_path is not None:
7878
return model_config_path
7979

@@ -132,8 +132,11 @@ def launch_model(
132132
# Default to dev_mode = True for launch_model()
133133
dev_mode = launch_args["dev_mode"] if "dev_mode" in launch_args else True
134134

135-
model_file = _inspect.getfile(model_class)
136-
model_dir = _pathlib.Path(model_file).parent
135+
try:
136+
model_file = _inspect.getfile(model_class)
137+
model_dir = _pathlib.Path(model_file).parent
138+
except OSError:
139+
model_dir = None
137140

138141
_sys_config = _resolve_config_file(sys_config, model_dir, dev_mode)
139142
_job_config = _resolve_config_file(job_config, model_dir, dev_mode)

0 commit comments

Comments
 (0)