Closed zdaiot closed 1 year ago
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
Thanks a lot~
First of all, thank you for your work, but when I use it, the same input will encounter different generation results, how to fix this generation?
As shown in the figure, this is the result of several new runs, but the results are completely different.