Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions test/test_hpu/test_auto_round.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ def run_opt_125m_on_hpu():
)
q_model, qconfig = autoround.quantize()
assert q_model is not None, "Expected q_model to be not None"
text = "Replace me by any text you'd like."
inputs = tokenizer(text, return_tensors="pt").to(model.device)
output = tokenizer.decode(q_model.generate(**inputs, max_new_tokens=10, do_sample=False)[0])
assert output is not None


@pytest.mark.skipif(not is_hpex_available(), reason="HPU is not supported")
Expand Down Expand Up @@ -75,3 +79,7 @@ def test_w4a8(data_type):
)
q_model, qconfig = autoround.quantize()
assert q_model is not None, "Expected q_model to be not None"
text = "Replace me by any text you'd like."
inputs = tokenizer(text, return_tensors="pt").to(model.device)
output = tokenizer.decode(q_model.generate(**inputs, max_new_tokens=10, do_sample=False)[0])
assert output is not None
Loading