plancraft 0.3.7__py3-none-any.whl → 0.3.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- plancraft/config.py +3 -1
- plancraft/evaluator.py +5 -12
- {plancraft-0.3.7.dist-info → plancraft-0.3.9.dist-info}/METADATA +1 -1
- {plancraft-0.3.7.dist-info → plancraft-0.3.9.dist-info}/RECORD +6 -6
- {plancraft-0.3.7.dist-info → plancraft-0.3.9.dist-info}/WHEEL +0 -0
- {plancraft-0.3.7.dist-info → plancraft-0.3.9.dist-info}/licenses/LICENSE +0 -0
plancraft/config.py
CHANGED
@@ -64,7 +64,9 @@ class LocalEnvSettings(BaseSettings):
|
|
64
64
|
openai_api_key: str = ""
|
65
65
|
wandb_api_key: str = ""
|
66
66
|
|
67
|
-
model_config = SettingsConfigDict(
|
67
|
+
model_config = SettingsConfigDict(
|
68
|
+
env_file=".env", env_file_encoding="utf-8", extra="ignore"
|
69
|
+
)
|
68
70
|
|
69
71
|
|
70
72
|
class EvalConfig(BaseModel):
|
plancraft/evaluator.py
CHANGED
@@ -194,7 +194,6 @@ class Evaluator:
|
|
194
194
|
"""Given the loaded model and an example from Plancraft
|
195
195
|
run the episode until success or termination."""
|
196
196
|
success = False
|
197
|
-
num_non_env_actions = 0
|
198
197
|
self.reset(example)
|
199
198
|
action = None
|
200
199
|
|
@@ -209,24 +208,18 @@ class Evaluator:
|
|
209
208
|
success = example.impossible
|
210
209
|
break
|
211
210
|
# action is external tool then it is str
|
212
|
-
|
213
|
-
|
214
|
-
observation =
|
215
|
-
|
211
|
+
if isinstance(action, str):
|
212
|
+
observation = self.environment.step()
|
213
|
+
observation["target"] = example.target
|
214
|
+
observation["message"] = action
|
216
215
|
# action is environment action
|
217
216
|
else:
|
218
|
-
|
219
|
-
observation = self.environment.step()
|
220
|
-
else:
|
221
|
-
observation = self.environment.step(action)
|
222
|
-
|
217
|
+
observation = self.environment.step(action)
|
223
218
|
# convert inventory observation to text message
|
224
219
|
observation["target"] = example.target
|
225
220
|
observation["message"] = self.convert_observation_to_message(
|
226
221
|
observation
|
227
222
|
)
|
228
|
-
num_non_env_actions = 0
|
229
|
-
|
230
223
|
# check if the episode is done
|
231
224
|
success = self.check_done(observation["inventory"], example.target)
|
232
225
|
# exit if success
|
@@ -1,6 +1,6 @@
|
|
1
1
|
plancraft/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
plancraft/config.py,sha256=
|
3
|
-
plancraft/evaluator.py,sha256=
|
2
|
+
plancraft/config.py,sha256=ShsFRlJ7plsl3ToD9fiO_4LDQuXdbjNV6Xp6o3Yk2Yg,4315
|
3
|
+
plancraft/evaluator.py,sha256=FogXAjnldK2K1gD02f2WW1YWvjWokKGUOJxwtwzGNjk,10804
|
4
4
|
plancraft/generate_dataset.py,sha256=DlrU-PmvWqSNJD1g1-8Lpb8n3N-Ogw3rje1nrRzjGKs,2382
|
5
5
|
plancraft/utils.py,sha256=phaHzbIS85YZrBPaGG9TStHY8ZBKR1LKfuN1exfVy1U,6889
|
6
6
|
plancraft/data/test.json,sha256=4jWfYMAVuZCFmGB4iZJAjlh9_8jXECdaGp8xn7_tAM4,1317131
|
@@ -1920,7 +1920,7 @@ plancraft/models/generators.py,sha256=F76_iPiqxUjDIrQwF58tzM0bLM91OkZJ0sBqBuki5w
|
|
1920
1920
|
plancraft/models/oracle.py,sha256=jDCE6zVFvbwFpDzQZTkHIlRwMud1yMJ4LVIdfpt5ddU,8449
|
1921
1921
|
plancraft/models/utils.py,sha256=E-sZohvolWgGbpHQKgAgkgIfUJoVnT5pMt6JP8xLHKg,4034
|
1922
1922
|
plancraft/train/dataset.py,sha256=oFqEd4LG9oEQ-71teh0Wf7-jJbtybT2ZibfM2bBdBkM,5474
|
1923
|
-
plancraft-0.3.
|
1924
|
-
plancraft-0.3.
|
1925
|
-
plancraft-0.3.
|
1926
|
-
plancraft-0.3.
|
1923
|
+
plancraft-0.3.9.dist-info/METADATA,sha256=zXrxilbtrVK05xX0jjFbDAub_tToabPX0wX1TULyUjA,11147
|
1924
|
+
plancraft-0.3.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
1925
|
+
plancraft-0.3.9.dist-info/licenses/LICENSE,sha256=YGR8ehDB4t-T-lOQKMfKNR-2zsOU7E3E5NA8t25HKE0,1070
|
1926
|
+
plancraft-0.3.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|