Skip to content

Commit

Permalink
increase temperature after first failed multiple choice attempt in gp…
Browse files Browse the repository at this point in the history
…t model

PiperOrigin-RevId: 600432140
Change-Id: I2f672492b72b0ad0e3d5854f165dc6825a3580cd
  • Loading branch information
jzleibo authored and copybara-github committed Jan 22, 2024
1 parent 2d5b835 commit 372b53c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion concordia/language_model/gpt_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,15 @@ def sample_choice(
)

for _ in range(_MAX_MULTIPLE_CHOICE_ATTEMPTS):
# Increase temperature after the first failed attempt.
temperature = 0.0
if attempts > 1:
temperature = 0.5

sample = self.sample_text(
prompt,
max_characters=max_characters,
temperature=0.0,
temperature=temperature,
seed=seed,
)
try:
Expand Down

0 comments on commit 372b53c

Please sign in to comment.