Skip to content

Commit

Permalink
Add type annotation (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
vwxyzjn authored Jul 31, 2024
1 parent db3fb37 commit 85ea4ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions open_instruct/dpo_tune.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,7 @@ def prepare_deepspeed(accelerator, model):
return model


def main():
parser = ArgumentParserPlus((FlatArguments))
args = parser.parse()

def main(args: FlatArguments):
# Initialize the accelerator. We will let the accelerator handle device placement for us in this example.
# If we're using tracking, we also need to initialize it here and it will by default pick up all supported trackers
# in the environment
Expand Down Expand Up @@ -657,4 +654,6 @@ def load_model():


if __name__ == "__main__":
main()
parser = ArgumentParserPlus((FlatArguments))
args = parser.parse()
main(args)
9 changes: 4 additions & 5 deletions open_instruct/finetune.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,7 @@ def save_with_accelerate(accelerator, model, tokenizer, output_dir, args):
)


def main():
parser = ArgumentParserPlus((FlatArguments))
args = parser.parse()

def main(args: FlatArguments):
# Initialize the accelerator. We will let the accelerator handle device placement for us in this example.
# If we're using tracking, we also need to initialize it here and it will by default pick up all supported trackers
# in the environment
Expand Down Expand Up @@ -690,4 +687,6 @@ def main():


if __name__ == "__main__":
main()
parser = ArgumentParserPlus((FlatArguments))
args = parser.parse()
main(args)

0 comments on commit 85ea4ad

Please sign in to comment.