Skip to content

Commit 685261d

Browse files
committed
Raise Value error when prompt list is empty
Signed-off-by: Abhishek <maurya.abhishek@ibm.com>
1 parent 7462077 commit 685261d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

aiu_fms_testing_utils/scripts/drive_paged_programs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,8 @@ def __prepare_inputs(batch_size, seq_length, tokenizer, enforce_sizes=[], seed=0
288288
encoded = encoded[:seq_length]
289289
prompt_list.append(encoded)
290290

291+
if not prompt_list:
292+
raise ValueError(f"No valid prompt sample exists in dataset for input shape (Batch Size={batch_size}, Seq Length={seq_length})")
291293
if len(prompt_list) < batch_size:
292294
dprint(
293295
f"You requested {batch_size} prompts but we were only able to get {len(prompt_list)} valid prompts. We will be repeating the first prompt."

0 commit comments

Comments
 (0)