Skip to content

Fix HF tokenization padding API + switch to torch AdamW#19

Open
Ishitaa7 wants to merge 1 commit intobehavioral-data:masterfrom
Ishitaa7:updated-code
Open

Fix HF tokenization padding API + switch to torch AdamW#19
Ishitaa7 wants to merge 1 commit intobehavioral-data:masterfrom
Ishitaa7:updated-code

Conversation

@Ishitaa7
Copy link

@Ishitaa7 Ishitaa7 commented Dec 24, 2025

Thanks a lot for your work. It’s been very helpful. While trying to use it, I ran into a few issues caused by outdated Hugging Face API usage, so this PR makes small compatibility fixes.

Specifically, it updates RoBERTa tokenization calls to the current HF Transformers API by replacing deprecated pad_to_max_length / return_attention_masks arguments with padding='max_length', return_attention_mask=True, and truncation=True where appropriate. It also replaces transformers.AdamW with torch.optim.AdamW, which is the currently recommended optimizer path.

These changes are purely for maintaining compatibility with recent library versions.

@Ishitaa7 Ishitaa7 changed the title fixed minor version issues Fix HF tokenization padding API + switch to torch AdamW Dec 25, 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.

1 participant