Skip to content

Commit

Permalink
Fix Platypus template when there are no inputs (additional one) (#2297)
Browse files Browse the repository at this point in the history
PR is doing the same thing as #2296 (just in one more location in the codebase which I have missed in the first pass)

Co-authored-by: dbogunowicz <[email protected]>
  • Loading branch information
eldarkurtic and dbogunowicz authored May 22, 2024
1 parent f16c623 commit fb7defa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sparseml/transformers/finetune/data/open_platypus.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def get_raw_dataset(self, cache_dir: Optional[str] = None):

# helper fn for restructuring each dataset entry using the alpaca template
def restructure_fn(sample):
if "input" in sample:
if "input" in sample and sample["input"] != "":
sample["text"] = self.ALPACA_TEMPLATE["prompt_input"].format(
instruction=sample["instruction"], input=sample["input"]
)
Expand Down

0 comments on commit fb7defa

Please sign in to comment.