Skip to content

Commit

Permalink
add transformers 4.47.0 ut
Browse files Browse the repository at this point in the history
Signed-off-by: Kaihui-intel <[email protected]>
  • Loading branch information
Kaihui-intel committed Dec 17, 2024
1 parent 56488d8 commit ffce8b6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/3x/torch/quantization/weight_only/test_transfomers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import pytest
import torch
import transformers
from packaging.version import Version
from transformers import AutoTokenizer

Expand Down Expand Up @@ -202,5 +203,9 @@ def test_loading_autoawq_model(self):
self.generate_kwargs = dict(do_sample=False, temperature=0.9, num_beams=4)
gen_ids = user_model.generate(input_ids, **self.generate_kwargs)
gen_text = tokenizer.batch_decode(gen_ids, skip_special_tokens=True)
target_text = ["One day, the little girl in the back of my mind will ask me if I'm a"]
# target_text = ["One day, the little girl in the back of my mind will ask me if I'm a"]
if Version(transformers.__version__) < Version("4.47.0"):
target_text = ["One day, the little girl in the back of my mind will ask me if I'm a"]
else:
target_text = ["One day, the little girl in the back of my mind will say, “I’m so glad you’"]
assert gen_text == target_text, "loading autoawq quantized model failed."

0 comments on commit ffce8b6

Please sign in to comment.