Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch and surface Runtime exceptions during preprocessing #2839

Merged
merged 3 commits into from
Dec 14, 2022

Conversation

arnavgarg1
Copy link
Contributor

In the existing implementation of model.preprocess, if there is an error or exception thrown, we never get to see it because of the way our try-except-finally block is written.

In particular, when preprocessing fails, the variables returned from preprocess_for_training aren't set/don't exist in scope during the finally block, which causes an UnboundLocalError for referencing a variable before definition.

This PR updates the implementation to catch the exception and issue a RuntimeError since model training can never succeed if preprocessing the data itself fails.

ludwig/api.py Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Dec 13, 2022

Unit Test Results

         6 files  ±0           6 suites  ±0   3h 34m 40s ⏱️ - 26m 15s
  3 532 tests ±0    3 461 ✔️ ±0    71 💤 ±0  0 ±0 
10 596 runs  ±0  10 368 ✔️ ±0  228 💤 ±0  0 ±0 

Results for commit 1841b00. ± Comparison against base commit bec4880.

♻️ This comment has been updated with latest results.

@arnavgarg1 arnavgarg1 changed the title Catch and surface exceptions during preprocessing Catch and surface Runtime exceptions during preprocessing Dec 14, 2022
@arnavgarg1 arnavgarg1 merged commit 5e5e924 into master Dec 14, 2022
@arnavgarg1 arnavgarg1 deleted the proc_training_set_error branch December 14, 2022 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants