Skip to content

Commit 2a9fd6d

Browse files
committed
n1 ready for test
1 parent 8fa89b8 commit 2a9fd6d

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

challenge/onsite_competition/sdk/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ def main():
5151
obs = env.get_observation()
5252

5353
# print("agent step...")
54-
# action is a integer in [0, 3], agent return [{'action': int, 'ideal_flag': bool}]
55-
action = agent.step(obs)[0]['action'] # only take the first env's action integer
54+
# action is a integer in [0, 3], agent return [{'action': [int], 'ideal_flag': bool}] (same to internvla_n1 agent)
55+
action = agent.step(obs)[0]['action'][0] # only take the first env's action integer
5656

5757
# print("env step...")
5858
env.step(action)

challenge/onsite_competition/sdk/test_agent.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ def test_agent(cfg_path=None, obs=None):
2323

2424
agent = AgentClient(cfg.agent)
2525
for _ in range(10):
26-
action = agent.step([obs])[0]['action'] # modify your agent to match the output format
26+
action = agent.step([obs])[0]['action'][0] # modify your agent to match the output format
2727
print(f"Action taken: {action}")
2828
assert action in [0, 1, 2, 3]
2929

3030

3131
if __name__ == "__main__":
3232
# use your own path
33-
cfg_path = '/root/InternNav/scripts/eval/configs/h1_rdp_cfg.py'
33+
# cfg_path = '/root/InternNav/scripts/eval/configs/h1_rdp_cfg.py'
34+
cfg_path = '/root/InternNav/scripts/eval/configs/h1_internvla_n1_cfg.py'
3435
rs_meta_path = 'challenge/onsite_competition/captures/rs_meta.json'
3536

3637
fake_obs_256 = {
@@ -51,5 +52,5 @@ def test_agent(cfg_path=None, obs=None):
5152

5253
# work in progress, baseline model will be updated soon
5354
# test_agent(cfg_path=cfg_path, obs=fake_obs_256)
54-
# test_agent(cfg_path='scripts/eval/configs/h1_internvla_n1_cfg.py', obs=fake_obs_640)
55+
test_agent(cfg_path=cfg_path, obs=fake_obs_640)
5556
print("All tests passed!")

0 commit comments

Comments
 (0)