Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix_gradient_accumulation_steps_in_examples #898

Conversation

zspo
Copy link
Contributor

@zspo zspo commented Sep 3, 2023

fix #895

Copy link
Member

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Thanks for providing the fixes. Just a small comment, the rest looks good.

@@ -207,9 +207,18 @@ def get_loss(cosine_score, labels):

def main():
args = parse_args()

# initialize accelerator
Copy link
Member

Choose a reason for hiding this comment

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

I think the comment is not necessary, as it is quite clear what happens here.

Regarding the initialization arguments, maybe they can be cleaned up a bit. WDYT about something like:

accelerator_kwargs = {"gradient_accumulation_steps": args.gradient_accumulation_steps}
if args.with_tracking:
    accelerator_kwargs["log_with"] = args.report_to
    accelerator_kwargs["project_dir"] = args.output_dir
accelerator = Accelerator(**accelerator_kwargs)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

update ! Thanks !

@zspo zspo requested a review from BenjaminBossan September 5, 2023 13:54
Copy link
Member

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Thank you for fixing the examples, looks good!

@BenjaminBossan BenjaminBossan merged commit d4dbf68 into huggingface:main Sep 6, 2023
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.

gradient_accumulation_steps problem in peft_lora_embedding_semantic_search.py
2 participants