aakashdandekar commited on
Commit
f38af3b
·
1 Parent(s): eb70591

Fix final sql_environment validation logic

Browse files
Files changed (1) hide show
  1. server/sql_environment.py +6 -1
server/sql_environment.py CHANGED
@@ -54,12 +54,17 @@ class SQLDebugEnvironment:
54
 
55
  if task_id and task_id in TASKS:
56
  self._current_task_id = task_id
 
 
 
 
57
  elif task_group and task_group in TASK_GROUPS:
58
  self._current_task_id = random.choice(TASK_GROUPS[task_group])
59
  self._task_group = task_group
60
  else:
61
 
62
  self._current_task_id = random.choice(list(TASKS.keys()))
 
63
 
64
  self._current_task = get_task(self._current_task_id)
65
  self._submissions = []
@@ -71,7 +76,7 @@ class SQLDebugEnvironment:
71
  self._state = State(
72
  episode_id=episode_id,
73
  step_count=0,
74
- task_id=self._current_task_id,
75
  max_steps=MAX_STEPS,
76
  cumulative_reward=0.0,
77
  )
 
54
 
55
  if task_id and task_id in TASKS:
56
  self._current_task_id = task_id
57
+ self._task_group = None
58
+ elif task_id and task_id in TASK_GROUPS:
59
+ self._current_task_id = random.choice(TASK_GROUPS[task_id])
60
+ self._task_group = task_id
61
  elif task_group and task_group in TASK_GROUPS:
62
  self._current_task_id = random.choice(TASK_GROUPS[task_group])
63
  self._task_group = task_group
64
  else:
65
 
66
  self._current_task_id = random.choice(list(TASKS.keys()))
67
+ self._task_group = None
68
 
69
  self._current_task = get_task(self._current_task_id)
70
  self._submissions = []
 
76
  self._state = State(
77
  episode_id=episode_id,
78
  step_count=0,
79
+ task_id=self._task_group if self._task_group else self._current_task_id,
80
  max_steps=MAX_STEPS,
81
  cumulative_reward=0.0,
82
  )