You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromllama_cppimportLlama# Load the modelmodel=Llama(
model_path="models/Meta-Llama-3-8B-Instruct-Q4_K_S-HF/Meta-Llama-3-8B-Instruct-Q4_K_S.gguf",
n_gpu_layers=128,
)
# Define the promptprompt="Once upon a time"foriinrange(5):
# Generate text with temperature = 1completion=model.create_completion(prompt=prompt, max_tokens=50, temperature=1.0, top_p=1.0, seed=-1)
# Print the generated textprint(completion['choices'][0]['text'])
The 5 outputs will be identical.
Verified with llama-cpp-python==0.3.1.
The text was updated successfully, but these errors were encountered:
In your example you use seed=-1. Could you confirm, that when not using top_p=1.0 the 5 outputs will be different, but every time it will be the same 5 outputs? I opened an issue here, which was not present in llama-cpp-python==0.2.9
Setting
top_p = 1
causes outputs to be identical even with a random seed. This was discovered by oobabooga/text-generation-webui#6431 (comment). See the full issue at oobabooga/text-generation-webui#6431.Reproduction
The 5 outputs will be identical.
Verified with
llama-cpp-python==0.3.1
.The text was updated successfully, but these errors were encountered: