fix bugs in sampler

This commit is contained in:
yuehuayingxueluo
2024-01-04 15:03:18 +08:00
committed by FrankLeeeee
parent 02c1bf8b2a
commit bbfebfb9fc
4 changed files with 12 additions and 8 deletions

View File

@@ -180,9 +180,9 @@ class RequestHandler:
"""
# do logit processor
# NOTE: need to decide the granularity to process logits (sequence or batch)
for type in ["top_p", "top_k", "min_p"]:
for type in ["top_k", "top_p", "min_p"]:
config_dict = generation_config.to_dict()
if type in config_dict:
if type in config_dict and config_dict[type] is not None:
logits = logit_processor(type, logits, config_dict[type])
torch.cuda.synchronize()