LMFlow
LMFlow copied to clipboard
[BUG] Do not use generation of hf model in inferencers
Describe the bug
As I mentioned in this issue, the default value of top_p and temperature is not guaranteed to be 1. Therefore, the code below will get a modified logits, i.e., a distribution processed depending on generation_config from hf end.
https://github.com/OptimalScale/LMFlow/blob/1b223f7693c2b8b91c7b6dfb7d7c48ab2d040834/src/lmflow/models/hf_decoder_model.py#L382-L405
Much worse, you applied top_p and temperature again in score_to_prob, resulting unexpected distribution:
https://github.com/OptimalScale/LMFlow/blob/1b223f7693c2b8b91c7b6dfb7d7c48ab2d040834/src/lmflow/pipeline/inferencer.py#L435-L440