Move for clarity

This commit is contained in:
Zuellni
2023-10-27 15:54:24 +02:00
parent dcaade09c2
commit 55871388b6
+3 -3
View File
@@ -112,12 +112,12 @@ class Generator:
input = model.tokenizer.encode(text)
stop_conditions = [model.tokenizer.eos_token_id]
if stop_on_newline:
stop_conditions.append(model.tokenizer.newline_token_id)
if not max_new_tokens:
max_new_tokens = model.config.max_seq_len - input.shape[-1]
if stop_on_newline:
stop_conditions.append(model.tokenizer.newline_token_id)
model.generator.set_stop_conditions(stop_conditions)
random.seed(seed)