Question about random output
zdaiot opened this issue · 2 comments
zdaiot commented
siriusctrl commented
The code use Huggingface api to do generation, so maybe you can try the following code to get deterministic results
generated_ids = generator(
gen_in,
max_new_tokens=200,
use_cache=True,
pad_token_id=tokenizer.eos_token_id,
num_return_sequences=1,
do_sample=False,
)
For more configs, you can see https://huggingface.co/docs/transformers/main_classes/text_generation
zdaiot commented
Thanks a lot~