fix hf gen args

Former-commit-id: 491a84976258cbb2a2647922420e2f84de1e38cd
This commit is contained in:
hiyouga 2024-05-19 19:39:32 +08:00
parent 351e80a656
commit fd02c9f973

View File

@ -97,6 +97,9 @@ class HuggingfaceEngine(BaseEngine):
if isinstance(num_return_sequences, int) and num_return_sequences > 1:
generating_args["do_sample"] = True
if not generating_args["temperature"]:
generating_args["do_sample"] = False
if not generating_args["do_sample"]:
generating_args.pop("temperature", None)
generating_args.pop("top_p", None)