Skip to content

Commit a8ad75e

Browse files
committed
try fixes
1 parent 3f936df commit a8ad75e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/models/opt/test_modeling_opt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def test_inference_no_head(self):
281281
attention_mask = input_ids.ne(model.config.pad_token_id)
282282
with torch.no_grad():
283283
output = model(input_ids=input_ids, attention_mask=attention_mask).last_hidden_state
284-
expected_shape = torch.Size((1, 11, 1024))
284+
expected_shape = torch.Size((1, 11, 512))
285285
self.assertEqual(output.shape, expected_shape)
286286
expected_slice = torch.tensor(
287287
[[0.7144, 0.8143, -1.2813], [0.7144, 0.8143, -1.2813], [-0.0467, 2.5911, -2.1845]], device=torch_device
@@ -348,8 +348,8 @@ def test_generation(self):
348348
GEN_OUTPUT = []
349349

350350
tokenizer = GPT2Tokenizer.from_pretrained("patrickvonplaten/opt_gpt2_tokenizer")
351-
for model in self.all_model_path:
352-
model = OPTForCausalLM.from_pretrained(self.path_model)
351+
for path_model in self.all_model_path:
352+
model = OPTForCausalLM.from_pretrained(path_model)
353353
model = model.eval()
354354
model.config.eos_token_id = tokenizer.eos_token_id
355355

0 commit comments

Comments
 (0)