[CI] 【Hackathon 9th Sprint No.20】NO.20 功能模块单测补充 by xunyoyo · Pull Request #5065 · PaddlePaddle/FastDeploy (original) (raw)

This commit adds unit tests for the sampler helpers, covering guided decoding and speculative flows. It includes various test cases to ensure the correct functionality of the sampling methods and processors.

python -m coverage run -m unittest tests.model_executor.test_sampler
&& python -m coverage report -m --include='fastdeploy/model_executor/sample/sampler.py'

Name Stmts Miss Cover Missing

fastdeploy/model_executor/layers/sample/sampler.py 390 69 82% 94-96, 98-100, 107, 112-113, 124, 127, 136, 143, 150, 153, 158, 170, 186, 193, 225, 241, 245, 249, 253, 356, 380, 421, 447-450, 466, 502-511, 518-533, 535, 575-576, 687-688, 717, 75 3-765, 772-791, 793, 833-834, 854-855

TOTAL 390 69 82%