Skip to content

Commit

Permalink
Add required_temp support in jsonl format to support flexible tempera…
Browse files Browse the repository at this point in the history
…ture setting for gen_api_answer (#2653)
  • Loading branch information
CodingWithTim authored Nov 8, 2023
1 parent 32c41de commit f2810e5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fastchat/llm_judge/gen_api_answer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@
def get_answer(
question: dict, model: str, num_choices: int, max_tokens: int, answer_file: str
):
assert (
args.force_temperature is not None and "required_temperature" in question.keys()
) == False
if args.force_temperature is not None:
temperature = args.force_temperature
elif "required_temperature" in question.keys():
temperature = question["required_temperature"]
elif question["category"] in temperature_config:
temperature = temperature_config[question["category"]]
else:
Expand Down

0 comments on commit f2810e5

Please sign in to comment.