Skip to content

Add docstrings to AlbertMLMHead and AlbertSOPHead forward methods#45266

Open
KetanP1618 wants to merge 1 commit intohuggingface:mainfrom
KetanP1618:docs/add-docstrings-albert-prediction-sop-head
Open

Add docstrings to AlbertMLMHead and AlbertSOPHead forward methods#45266
KetanP1618 wants to merge 1 commit intohuggingface:mainfrom
KetanP1618:docs/add-docstrings-albert-prediction-sop-head

Conversation

@KetanP1618
Copy link
Copy Markdown

What does this PR do?

Adds missing docstrings to two undocumented forward methods in the ALBERT model:

  • AlbertMLMHead.forward - Added Args and Returns sections
  • AlbertSOPHead.forward - Added Args and Returns sections

Both methods previously had no documentation at all. This improves
documentation coverage for ALBERT model heads and helps users
understand the expected inputs and outputs.

Tests

Verified both classes work correctly:

  • AlbertMLMHead output shape: torch.Size([2, 10, 30000])
  • AlbertSOPHead output shape: torch.Size([2, 2])

- Added Args and Returns sections to AlbertMLMHead.forward
- Added Args and Returns sections to AlbertSOPHead.forward
- Improves documentation coverage for ALBERT model heads
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

[For maintainers] Suggested jobs to run (before merge)

run-slow: albert

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