Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@MHashemzadeh
Copy link
Collaborator

This pull request is to release the code for our paper "SUB-GOAL DISTILLATION: A METHOD TO IMPROVE SMALL LANGUAGE AGENTS", accepted at CoLLAs 2024. The codebase is a modification and extension of the existing SwiftSage repository.

Copy link

@hnekoeiq hnekoeiq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the high level comments. Will take a look later when these are addressed and approve it. Great Job!

README.md Outdated

## 2- Train models

Codes for train models are in `/train`. Three models which are small LM are required to fine-tune: 1- action generator (executor), 2- sub-goal generator (contoroller), 3- first sub-goal generator.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its a minor grammatical error but --> for "training the models" and "required to be fine-tuned"
Overal passing the text through ChatGPT or Grammarly could be a good idea.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

README.md Outdated

# Acknowledgements

We thank SwiftSage implementation, which this repo is based upon.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably you wanted to say "We thank the authors of SwiftSage repository"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

task_id_to_actions = {}
task_id = args.task_id

for i in range(1):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why there is a for loop here if it is range(1)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some time we wanted to have an iteration. That is why. But I removed it



def downsampling(task_idx_real, curr_task_seq):
# Downsampling Task 26 and 29

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part of the code could have been written by the others but docstrings and comments should have been added for all nontrivial functions. E.g. Why Downsampling has been done only for task 26 and 29?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because only these two have a lot of variations. In scienceworld the number of variations of the tasks are different. So it is ok.



return steps_cp, subgoals_list_insteps

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is recommended to remove empty space.

return actions_list, subgoal_action_index_list

def check_action_sg(actions_list, gold_path, sg_act_idx_list, task_desc, chatgpt_answer):
print(f'len goal path {len(gold_path)} ---- len action seq {len(actions_list)}')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, adding a short docstring could be helpful.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added them.



def creat_semi_random_sg(first_subgoal, PossibleObjects, locations):
### this function chnage the objects or locations in the subgoals to generates semi-random subgoals.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link

@hnekoeiq hnekoeiq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@MHashemzadeh MHashemzadeh merged commit 08ac7b3 into main Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants