Skip to content

Commit

Permalink
Generate: Fix CI related to huggingface#20727 (huggingface#21003)
Browse files Browse the repository at this point in the history
  • Loading branch information
gante authored and silverriver committed Jan 6, 2023
1 parent e4f8614 commit e3250d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/generation/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3035,7 +3035,7 @@ def test_eos_token_id_int_and_list_greedy_search(self):

tokenizer = GPT2Tokenizer.from_pretrained("hf-internal-testing/tiny-random-gpt2")
text = """Hello, my dog is cute and"""
tokens = tokenizer(text, return_tensors="pt")
tokens = tokenizer(text, return_tensors="pt").to(torch_device)

model = GPT2LMHeadModel.from_pretrained("hf-internal-testing/tiny-random-gpt2").to(torch_device)

Expand All @@ -3060,7 +3060,7 @@ def test_eos_token_id_int_and_list_contrastive_search(self):

tokenizer = GPT2Tokenizer.from_pretrained("hf-internal-testing/tiny-random-gpt2")
text = """Hello, my dog is cute and"""
tokens = tokenizer(text, return_tensors="pt")
tokens = tokenizer(text, return_tensors="pt").to(torch_device)

model = GPT2LMHeadModel.from_pretrained("hf-internal-testing/tiny-random-gpt2").to(torch_device)

Expand All @@ -3086,7 +3086,7 @@ def test_eos_token_id_int_and_list_top_k_top_sampling(self):

tokenizer = GPT2Tokenizer.from_pretrained("hf-internal-testing/tiny-random-gpt2")
text = """Hello, my dog is cute and"""
tokens = tokenizer(text, return_tensors="pt")
tokens = tokenizer(text, return_tensors="pt").to(torch_device)

model = GPT2LMHeadModel.from_pretrained("hf-internal-testing/tiny-random-gpt2").to(torch_device)

Expand All @@ -3109,7 +3109,7 @@ def test_eos_token_id_int_and_list_beam_search(self):

tokenizer = GPT2Tokenizer.from_pretrained("hf-internal-testing/tiny-random-gpt2")
text = """Hello, my dog is cute and"""
tokens = tokenizer(text, return_tensors="pt")
tokens = tokenizer(text, return_tensors="pt").to(torch_device)

model = GPT2LMHeadModel.from_pretrained("hf-internal-testing/tiny-random-gpt2").to(torch_device)

Expand Down

0 comments on commit e3250d1

Please sign in to comment.