Skip to content

Refactor GPT-J output tracing to use standardized decorators#45365

Closed
burtenshaw wants to merge 1 commit intohuggingface:mainfrom
burtenshaw:codex/cluster-43979-21-20260410T192041Z
Closed

Refactor GPT-J output tracing to use standardized decorators#45365
burtenshaw wants to merge 1 commit intohuggingface:mainfrom
burtenshaw:codex/cluster-43979-21-20260410T192041Z

Conversation

@burtenshaw
Copy link
Copy Markdown
Contributor

Applied the overlapping GPT-J refactor from the staged PRs: added _can_record_outputs, moved GPTJModel.forward to decorator-based output capture, switched wrapper forwards to @can_return_tuple, and removed manual hidden-state/attention plumbing. Static validation passed (compileall, make style, git diff --check); pytest could not run in this environment because torch is unavailable and importing transformers also reported missing safetensors package metadata.

Target issue: #43979.

Tests:

  • python -m compileall src/transformers/models/gptj/modeling_gptj.py
  • python -m pytest tests/models/gptj/test_modeling_gptj.py -q
  • PYTHONPATH=src python -m pytest tests/models/gptj/test_modeling_gptj.py -q
  • make style
  • git diff --check

Source PRs:

@github-actions
Copy link
Copy Markdown
Contributor

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

run-slow: gptj

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

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