plancraft 0.3.9__py3-none-any.whl → 0.3.11__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/evaluator.py CHANGED
@@ -198,9 +198,7 @@ class Evaluator:
198
198
  action = None
199
199
 
200
200
  # run episode until stuck or until max steps is reached
201
- while (
202
- not self.history.check_stuck() and self.history.num_steps < self.max_steps
203
- ):
201
+ while self.history.num_steps < self.max_steps:
204
202
  # if the action is stop then we end the episode
205
203
  if isinstance(action, StopAction):
206
204
  # if the action is stop and task is impossible then success
plancraft/utils.py CHANGED
@@ -44,8 +44,6 @@ class History:
44
44
  self.resolution = resolution # low, medium, high
45
45
 
46
46
  self.inventory_history = []
47
- self.inventory_counters = []
48
-
49
47
  self.tokens_used = 0
50
48
 
51
49
  # use system prompt if provided
@@ -105,14 +103,6 @@ class History:
105
103
 
106
104
  def add_inventory_to_history(self, inventory: dict):
107
105
  self.inventory_history.append(inventory)
108
- # count inventory
109
- counter = Counter()
110
- for slot, item in inventory.items():
111
- # ignore slot 0
112
- if slot == 0:
113
- continue
114
- counter[item["type"]] += item["quantity"]
115
- self.inventory_counters.append(counter)
116
106
 
117
107
  def add_image_to_history(self, image):
118
108
  self.images.append(image)
@@ -121,11 +111,6 @@ class History:
121
111
  if observation is None:
122
112
  return
123
113
  if "inventory" in observation:
124
- # clean_inv = []
125
- # remove empty slots
126
- # for slot, item in observation["inventory"].items():
127
- # if item["quantity"] > 0:
128
- # clean_inv.append(item)
129
114
  self.add_inventory_to_history(observation["inventory"])
130
115
  if "image" in observation:
131
116
  self.add_image_to_history(observation["image"])
@@ -140,7 +125,6 @@ class History:
140
125
  self.initial_dialogue_length = len(self.dialogue_history)
141
126
 
142
127
  self.inventory_history = []
143
- self.inventory_counters = []
144
128
 
145
129
  self.tokens_used = 0
146
130
 
@@ -157,21 +141,6 @@ class History:
157
141
  def num_steps(self):
158
142
  return (len(self.dialogue_history) - self.initial_dialogue_length) // 2
159
143
 
160
- def check_stuck(self, max_steps_no_change: int = 10) -> bool:
161
- """
162
- If inventory content does not change for max_steps_no_change steps
163
- the agent is considered stuck.
164
-
165
- With N=10, the oracle solver can still solve 100% of the examples
166
- """
167
- if len(self.inventory_counters) <= max_steps_no_change:
168
- return False
169
-
170
- return all(
171
- c == self.inventory_counters[-max_steps_no_change - 1]
172
- for c in self.inventory_counters[-max_steps_no_change - 1 :]
173
- )
174
-
175
144
 
176
145
  def get_downloaded_models() -> dict:
177
146
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plancraft
3
- Version: 0.3.9
3
+ Version: 0.3.11
4
4
  Summary: Plancraft: an evaluation dataset for planning with LLM agents
5
5
  License: MIT License
6
6
 
@@ -1,8 +1,8 @@
1
1
  plancraft/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  plancraft/config.py,sha256=ShsFRlJ7plsl3ToD9fiO_4LDQuXdbjNV6Xp6o3Yk2Yg,4315
3
- plancraft/evaluator.py,sha256=FogXAjnldK2K1gD02f2WW1YWvjWokKGUOJxwtwzGNjk,10804
3
+ plancraft/evaluator.py,sha256=vu8RqAsvoDtUizLpiDA9w1fmCdCb6q91DUuE_4mUhUo,10745
4
4
  plancraft/generate_dataset.py,sha256=DlrU-PmvWqSNJD1g1-8Lpb8n3N-Ogw3rje1nrRzjGKs,2382
5
- plancraft/utils.py,sha256=phaHzbIS85YZrBPaGG9TStHY8ZBKR1LKfuN1exfVy1U,6889
5
+ plancraft/utils.py,sha256=0Uq-3VE-bTRstalzKknBJ-ExWf8ec_Jrg4QNEk8bJ-o,5778
6
6
  plancraft/data/test.json,sha256=4jWfYMAVuZCFmGB4iZJAjlh9_8jXECdaGp8xn7_tAM4,1317131
7
7
  plancraft/data/test.small.easy.json,sha256=5NZEJ2PqIgmHQecJOIVQyM1D6GFKyJq7GVmgRudaqQk,189304
8
8
  plancraft/data/test.small.json,sha256=eULAG1rdolRMXPrecV-7YoDIheKGyIT5MVpWdISV0wg,270089
@@ -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.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,,
1923
+ plancraft-0.3.11.dist-info/METADATA,sha256=wgvEebVv8N2uL51t9oRGEgkniXkbUCZbshDZPY7kRIo,11148
1924
+ plancraft-0.3.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
1925
+ plancraft-0.3.11.dist-info/licenses/LICENSE,sha256=YGR8ehDB4t-T-lOQKMfKNR-2zsOU7E3E5NA8t25HKE0,1070
1926
+ plancraft-0.3.11.dist-info/RECORD,,