Fix failling GGML test (#34871)

fix_test
This commit is contained in:
Mohamed Mekkouri
2024-11-25 18:04:52 +01:00
committed by GitHub
parent b76a292bde
commit 890ea7de93

View File

@@ -623,8 +623,8 @@ class GgufIntegrationTests(unittest.TestCase):
torch_dtype=torch.float16, torch_dtype=torch.float16,
) )
text = tokenizer(self.example_text, return_tensors="pt").to(torch_device) text = tokenizer(self.example_text, return_tensors="pt")["input_ids"].to(torch_device)
out = model.generate(**text, max_new_tokens=10) out = model.generate(text, max_new_tokens=10)
EXPECTED_TEXT = "Hello All,\nI am new to this forum." EXPECTED_TEXT = "Hello All,\nI am new to this forum."
self.assertEqual(tokenizer.decode(out[0], skip_special_tokens=True), EXPECTED_TEXT) self.assertEqual(tokenizer.decode(out[0], skip_special_tokens=True), EXPECTED_TEXT)