Skip to content

Commit 219abba

Browse files
younesbelkadaLysandreJik
authored andcommitted
OPT-fix (#17229)
* try fixes * Revert "try fixes" This reverts commit a8ad75e. * add correct shape * add correct path
1 parent a1651b5 commit 219abba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/models/opt/test_modeling_opt.py

Lines changed: 2 additions & 2 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
@@ -306,7 +306,7 @@ def test_load_model(self):
306306
def test_logits(self):
307307
model = OPTForCausalLM.from_pretrained(self.path_model)
308308
model = model.eval()
309-
tokenizer = GPT2Tokenizer.from_pretrained("patrickvonplaten/opt_gpt2_tokenizer")
309+
tokenizer = GPT2Tokenizer.from_pretrained(self.path_model)
310310
tokenizer.add_special_tokens({"pad_token": "<pad>"})
311311

312312
prompts = [

0 commit comments

Comments
 (0)