Skip to content

Commit

Permalink
Minor test issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucaweihs committed Jan 23, 2024
1 parent 9c6db90 commit 0e00b36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions allenact/utils/model_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Functions used to initialize and manipulate pytorch models."""
import hashlib
from collections import Callable
from typing import Sequence, Tuple, Union, Optional, Dict, Any
from typing import Sequence, Tuple, Union, Optional, Dict, Any, Callable

import numpy as np
import torch
Expand Down
4 changes: 3 additions & 1 deletion tests/utils/test_inference_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,17 @@ def test_inference_agent_from_minigrid_config(self):
task = task_sampler.next_task()
observations = task.get_observations()

actions = []
while not task.is_done():
action = agent.act(observations=observations)
actions.append(action)
observations = task.step(action).observation

assert all(
abs(v - expected_result[k]) < 1e-4
for k, v in task.metrics().items()
if k != "task_info"
)
), f"Failed on task {ind} with actions {actions} and metrics {task.metrics()} (expected={expected_result})."


if __name__ == "__main__":
Expand Down

0 comments on commit 0e00b36

Please sign in to comment.