Skip to content

Commit

Permalink
docker
Browse files Browse the repository at this point in the history
  • Loading branch information
ydshieh committed Feb 7, 2024
1 parent 23de08d commit e6eb5a6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/models/llama/test_inference_llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ def test_foo(self):
model = AutoModelForCausalLM.from_pretrained(ckpt, torch_dtype=torch.float16, token=hf_token)
model.to(device)

# To make generation's sample deterministic
torch.manual_seed(0)

# Generate
with torch.no_grad():
generate_ids = model.generate(inputs.input_ids, max_length=30)
Expand Down

0 comments on commit e6eb5a6

Please sign in to comment.