Skip to content

Commit

Permalink
Raise ValueError in SelfInstructTask.to_argilla_record
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarobartt committed Dec 20, 2023
1 parent 865feb9 commit 9f18b38
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/distilabel/tasks/text_generation/self_instruct.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,8 @@ def to_argilla_record(
fields["instruction"] = instruction
metadata["length-instruction"] = len(instruction)
records.append(rg.FeedbackRecord(fields=fields, metadata=metadata))
if not records:
raise ValueError(
f"Skipping the row {dataset_row} as the list of `FeedbackRecord` is empty as those could not be inferred."
)
return records

0 comments on commit 9f18b38

Please sign in to comment.