From f16c6237ca84157d843327c0c7d8aad97a3dc900 Mon Sep 17 00:00:00 2001 From: Eldar Kurtic Date: Tue, 21 May 2024 22:20:45 +0200 Subject: [PATCH] Fix Platypus template when there are no inputs (#2296) Co-authored-by: Alexandre Marques --- src/sparseml/experimental/sparsegpt/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sparseml/experimental/sparsegpt/utils.py b/src/sparseml/experimental/sparsegpt/utils.py index 191c97d3369..6811df5ed79 100644 --- a/src/sparseml/experimental/sparsegpt/utils.py +++ b/src/sparseml/experimental/sparsegpt/utils.py @@ -373,7 +373,7 @@ def get_openplatypus(nsamples, seed, seqlen, model, split): tokenizer = AutoTokenizer.from_pretrained(model) def _process_sample(sample): - if "input" in sample: + if "input" in sample and sample["input"] != "": processed_sample = alpaca_template["prompt_input"].format( instruction=sample["instruction"], input=sample["input"] )