Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- server/environment.py +5 -5
server/environment.py
CHANGED
|
@@ -152,7 +152,7 @@ class NL2SQLEnvironment(Environment):
|
|
| 152 |
self._last_obs = obs
|
| 153 |
return obs
|
| 154 |
|
| 155 |
-
def step(self, action: NL2SQLAction) ->
|
| 156 |
"""Execute the agent's SQL and return graded observation."""
|
| 157 |
if self._task is None or self._example is None:
|
| 158 |
# Called before reset β auto-reset
|
|
@@ -212,9 +212,9 @@ class NL2SQLEnvironment(Environment):
|
|
| 212 |
)
|
| 213 |
self._last_obs = obs
|
| 214 |
|
| 215 |
-
#
|
| 216 |
-
|
| 217 |
-
return obs
|
| 218 |
|
| 219 |
@property
|
| 220 |
def state(self) -> NL2SQLState:
|
|
@@ -223,4 +223,4 @@ class NL2SQLEnvironment(Environment):
|
|
| 223 |
# ββ Helpers ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 224 |
|
| 225 |
def available_tasks(self) -> list:
|
| 226 |
-
return all_task_names()
|
|
|
|
| 152 |
self._last_obs = obs
|
| 153 |
return obs
|
| 154 |
|
| 155 |
+
def step(self, action: NL2SQLAction) -> NL2SQLObservation:
|
| 156 |
"""Execute the agent's SQL and return graded observation."""
|
| 157 |
if self._task is None or self._example is None:
|
| 158 |
# Called before reset β auto-reset
|
|
|
|
| 212 |
)
|
| 213 |
self._last_obs = obs
|
| 214 |
|
| 215 |
+
# openenv-core expects ONLY the observation returned from step().
|
| 216 |
+
# The framework reads obs.reward and obs.done itself β do NOT return a tuple.
|
| 217 |
+
return obs
|
| 218 |
|
| 219 |
@property
|
| 220 |
def state(self) -> NL2SQLState:
|
|
|
|
| 223 |
# ββ Helpers ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 224 |
|
| 225 |
def available_tasks(self) -> list:
|
| 226 |
+
return all_task_names()
|