Check if the prompt's not empty before loading anything

This commit is contained in:
Zuellni
2023-10-07 11:02:33 +02:00
parent 6e78068c1a
commit 09bc77ba94
+3 -3
View File
@@ -74,13 +74,13 @@ class Generator:
seed,
text,
):
tokenizer, generator, settings = model
progress = ProgressBar(max_tokens)
if not text:
return ("",)
tokenizer, generator, settings = model
progress = ProgressBar(max_tokens)
prompt = tokenizer.encode(text)
stop_conditions = [tokenizer.eos_token_id]
stop_on_newline and stop_conditions.append(tokenizer.newline_token_id)
generator.set_stop_conditions(stop_conditions)