Skip to content

Conversation

@Letssharearow
Copy link
Contributor

AdamW doesn't exist in the transformer library
{40090E72-994C-4A4E-B320-C72799048E47}

instead you can import AdamW from torch.optim
{37691C84-F074-4DFC-9C68-C8E6B022264D}

This is alreayd done in the course repository:
https://github.com/huggingface/course/blob/main/chapters/en/chapter3/4.mdx

And as other commits also directly change the files in here, I am not sure if this comment is still relevant:
course: Open a PR directly on the course repo (https://github.com/huggingface/course)

@sgugger

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

"outputs": [],
"source": [
"from transformers import AdamW\n",
"from torch.optim import AdamW\n",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

realizing there were some hidden changes in the jupyter notebook, this is the relevant change

"source": [
"from transformers import AdamW, AutoModelForSequenceClassification, get_scheduler\n",
"from transformers import AutoModelForSequenceClassification, get_scheduler\n",
"from torch.optim import AdamW\n",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

And here, too. It's 2 import changes from 2 cells

Copy link
Member

@pcuenca pcuenca left a comment

Choose a reason for hiding this comment

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

Hello @Letssharearow, thank you for your contribution! Would you mind submitting just the relevant changes, rather than replacing the notebook? I can't even see the diff in github because it's too large:
Screenshot 2025-11-10 at 18 11 46

For reference, here's how a related PR did it: https://github.com/huggingface/notebooks/pull/606/files

@Letssharearow Letssharearow force-pushed the main branch 3 times, most recently from 5640a3f to ec81b7b Compare November 11, 2025 05:50
@Letssharearow
Copy link
Contributor Author

@pcuenca
Thank you, I realised it but only wanted to do the effort if Im actually in the right place
I figured it out by eventually now. May I ask, do you know why it's not synced with the course repo?

Copy link
Member

@pcuenca pcuenca 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!

@pcuenca
Copy link
Member

pcuenca commented Nov 11, 2025

why it's not synced with the course repo?

Not sure, to be honest. I don't think there's an automatic process to sync them, these are just code-only notebooks without much of the prose in the course. cc @burtenshaw as he may know more details.

@pcuenca pcuenca merged commit 926f21d into huggingface:main Nov 11, 2025
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.

2 participants