Skip to content

Commit

Permalink
llmblock: fix batched=False
Browse files Browse the repository at this point in the history
_generate() returns a list of samples. The previouis code would create
a list of lists when batching was turned off. This restores that case
back to a list of samples.

Signed-off-by: Russell Bryant <[email protected]>
  • Loading branch information
russellb authored and markmc committed Jun 28, 2024
1 parent d53a57a commit 14d646f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/instructlab/sdg/llmblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def generate(self, samples, **gen_kwargs) -> Dataset:
if batched:
outputs = self._generate(samples, **gen_kwargs)
else:
outputs = [self._generate([sample], **gen_kwargs) for sample in samples]
outputs = [self._generate([sample], **gen_kwargs)[0] for sample in samples]

new_data = []
for sample, output in zip(samples, outputs):
Expand Down

0 comments on commit 14d646f

Please sign in to comment.