Skip to content

Commit e70f109

Browse files
authored
Catch errors when loading external main in fdl_runner (#162)
Signed-off-by: Hemil Desai <[email protected]>
1 parent e95df71 commit e70f109

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/nemo_run/core/runners/fdl_runner.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
import logging
17+
1618
import typer
1719

1820
fdl_runner_app = typer.Typer(pretty_exceptions_enable=False)
@@ -49,7 +51,11 @@ def fdl_direct_run(
4951
fdl_package.setup()
5052

5153
if os.path.isfile(fdl_config):
52-
maybe_load_external_main(Path(fdl_config).parent.parent.parent)
54+
try:
55+
maybe_load_external_main(Path(fdl_config).parent.parent.parent)
56+
except Exception as e:
57+
logging.warning(f"Failed to load external main: {e}")
58+
5359
fdl_config = Path(fdl_config).read_text()
5460

5561
fdl_buildable: fdl.Buildable = ZlibJSONSerializer().deserialize(fdl_config)

0 commit comments

Comments
 (0)