Skip to content

Commit 4c2ef7a

Browse files
authored
add team names and round number to visualizer (#264)
1 parent da684ac commit 4c2ef7a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

kaggle_environments/envs/llm_20_questions/llm_20_questions.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ async function renderer(context) {
9090

9191
const info = environment.info;
9292
const team1_text = info?.TeamNames?.[0] || "Team 1";
93-
const team2_text = info?.TeamNames?.[1] || "Team 2";
93+
const team2_text = info?.TeamNames?.[2] || "Team 2";
9494

9595
const ctx = canvas.getContext("2d");
9696
const padding = 20;
@@ -112,12 +112,13 @@ async function renderer(context) {
112112

113113
// Keyword Row
114114
ctx.fillText("Keyword: " + state[1].observation.keyword, label_x, line_height * line);
115+
ctx.fillText("Round: " + Math.floor(step / 3 + 1), team2_x, line_height * line);
115116

116117
line += 2;
117118

118119
// Team Row
119120
ctx.fillText(team1_text, team1_x, line_height * line);
120-
ctx.fillText(team2_text, team2_x, line_height *line);
121+
ctx.fillText(team2_text, team2_x, line_height * line);
121122

122123
line++;
123124

kaggle_environments/envs/llm_20_questions/llm_20_questions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
def guesser_agent(obs):
4343
info_prompt = """You are playing a game of 20 questions where you ask the questions and try to figure out the keyword, which will be a real or fictional person, place, or thing. \nHere is what you know so far:\n{q_a_thread}"""
4444
questions_prompt = """Ask one yes or no question."""
45-
guess_prompt = """Guess the keyword. Only respond with the exact word/phrase. For example, if you think the keyword is [paris], don't respond with [I think the keyword is paris] or [Is the kewyord Paris?]. Respond only with the word [paris]."""
45+
guess_prompt = """Guess the keyword. Only respond with the exact word/phrase. For example, if you think the keyword is [paris], don't respond with [I think the keyword is paris] or [Is the keyword Paris?]. Respond only with the word [paris]."""
4646

4747
q_a_thread = ""
4848
for i in range(0, len(obs.answers)):

0 commit comments

Comments
 (0)