Skip to content

Commit

Permalink
Merge pull request meta-llama#779 from javier-m/add-seed
Browse files Browse the repository at this point in the history
add seed
  • Loading branch information
jspisak authored Sep 15, 2023
2 parents d7e2e37 + c9c493f commit 7173899
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llama/generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def build(
max_seq_len: int,
max_batch_size: int,
model_parallel_size: Optional[int] = None,
seed: int = 1,
) -> "Llama":
"""
Build a Llama instance by initializing and loading a pre-trained model.
Expand Down Expand Up @@ -91,7 +92,7 @@ def build(
torch.cuda.set_device(local_rank)

# seed must be the same in all processes
torch.manual_seed(1)
torch.manual_seed(seed)

if local_rank > 0:
sys.stdout = open(os.devnull, "w")
Expand Down

0 comments on commit 7173899

Please sign in to comment.