Commit 2483ba01 authored by jameskrw's avatar jameskrw
Browse files

update navigation prompt

parent 69c1f70e
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -173,6 +173,7 @@ class NavigationEnv(BaseEnv):
        self.img_paths = []
        self.total_reward = 0
        
        
        return self._render(init_obs=True), {}
    
    def step(self, action_str: str):
@@ -322,14 +323,16 @@ class NavigationEnv(BaseEnv):
        # Format the template
        if init_obs:
            obs_str = init_observation_template.format(
                observation=img_placeholder
                observation=img_placeholder,
                instruction=self.episode_language_instruction,
            )
        else:
            obs_str = action_template.format(
                valid_action=self.valid_actions,
                observation=img_placeholder,
                reward=self.reward,
                done=self.measure_success()[0]
                done=self.measure_success()[0],
                instruction=self.episode_language_instruction,
            )
        
        return {
+7 −1
Original line number Diff line number Diff line
@@ -20,13 +20,17 @@ Format correct: +0.5
Achieve the human instruction: +10.0

Please think step by step and provide the actions you want to take.

You can provide a list of actions, separated by commas. For example: moveahead, moveright, rotateright.
Your reponse should be in the format of <think>...</think><answer>...</answer>
e.g.
<think>I can see from the sight the target object is right in the top left of me, I will move forward, then move left to access it.</think><answer>moveahead, moveahead,moveahead,moveahead,moveahead,moveleft,moveleft</answer>
"""

system_prompt_vision = """You are a home robot and perform navigation tasks according to instructions.

Navigation Guide
Goal: Achieve the human instruction
You should follow the human instruction and navigate to the target location.

Actions you can take: moveahead, moveback, moveright, moveleft, rotateright, rotateleft, lookup, lookdown. 
You can take up to {max_actions_per_step} action(s) at a time.
@@ -50,6 +54,7 @@ The instruction will be provided with each observation. Look at the image carefu
init_observation_template = """
[Initial Observation]:
{observation}
Human Instruction: {instruction}
Decide your next action(s).
Your reponse should be in the format of <think>...</think><answer>...</answer>
"""
@@ -59,6 +64,7 @@ After that, the observation is:
{observation}
reward: {reward}
done: {done}
Human Instruction: {instruction}
Decide your next action(s).
Your reponse should be in the format of <think>...</think><answer>...</answer>
"""
 No newline at end of file