Generating multiple responses from the same prompt

#50
by OfriH - opened

Hey,
when I try to run the same prompt more than once, I get the same result.
Do you know how I can change the template or any other parameter to generate a different response?

Google org

Hi @OfriH ,You can increase the temperature parameter in the model's configuration. This controls the randomness of the output and higher temperatures lead to more diverse outputs.
outputs = model.generate(**input_ids, max_length=200, temperature=0.7)

Low temperature (close to 0): The model will tend to be more deterministic, generating text that is more predictable and focused.
High temperature (close to 1): The model will be more random, generating text with a wider range of possibilities.

Thank you for your help!

Sign up or log in to comment