Files
enginex-ascend-910-vllm/tests/ut/sample/test_sampler.py

11 lines
460 B
Python
Raw Normal View History

2025-09-09 09:40:35 +08:00
from tests.ut.base import TestBase
from vllm_ascend.sample.sampler import AscendSampler, AscendTopKTopPSampler
class TestAscendSampler(TestBase):
def test_init_with_raw_logprobs(self):
sampler = AscendSampler(logprobs_mode="raw_logprobs")
self.assertEqual(sampler.logprobs_mode, "raw_logprobs")
self.assertTrue(hasattr(sampler, "topk_topp_sampler"))
2025-09-09 09:40:35 +08:00
self.assertIsInstance(sampler.topk_topp_sampler, AscendTopKTopPSampler)