Skip to content

Commit

Permalink
generate_data: Fix check for output in results
Browse files Browse the repository at this point in the history
This code would hit an unepxected traceback if the result had the
`output` column, but its value in a given row was `None`. This check
detects that case and raises the Exception as intended.

Signed-off-by: Russell Bryant <[email protected]>
  • Loading branch information
russellb committed Jul 3, 2024
1 parent 2788384 commit 8b3b0e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/instructlab/sdg/generate_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def _get_question(logger, synth_example):
if "question" in synth_example:
return synth_example["question"]

if "output" not in synth_example:
if not synth_example.get("output"):
raise utils.GenerateException(
f"Error: output not found in synth_example: {synth_example}"
)
Expand Down

0 comments on commit 8b3b0e7

Please sign in to comment.