Skip to content

fix(demos): port LIT integration demo model loading to TransformerBridge - #1758

Merged
jlarson4 merged 2 commits into
TransformerLensOrg:dev-4.xfrom
ZacharyZcR:fix/lit-demo-bridge-migration
Sep 9, 2026
Merged

fix(demos): port LIT integration demo model loading to TransformerBridge#1758
jlarson4 merged 2 commits into
TransformerLensOrg:dev-4.xfrom
ZacharyZcR:fix/lit-demo-bridge-migration

Conversation

@ZacharyZcR

Copy link
Copy Markdown

Description

In #1740 the imports in demos/LIT_Integration_Demo.ipynb were updated to TransformerBridge, but the model loading cell still called HookedTransformer.from_pretrained(...). Because HookedTransformer was no longer imported, running that cell raised NameError: name 'HookedTransformer' is not defined.

This completes the alignment for the LIT demo:

  • Updates model loading from HookedTransformer.from_pretrained to TransformerBridge.boot_transformers("gpt2") with enable_compatibility_mode().
  • Updates the following markdown cell to refer to model instead of HookedTransformer.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have not rewritten tests relating to key interfaces which would affect backward compatibility

ZacharyZcR and others added 2 commits September 9, 2026 06:14
In TransformerLensOrg#1740 the import in LIT_Integration_Demo.ipynb was updated to
TransformerBridge, but the model loading cell still called
HookedTransformer.from_pretrained, which raised a NameError since
HookedTransformer was no longer imported.

Update the cell to load via TransformerBridge.boot_transformers with
enable_compatibility_mode().
@jlarson4
jlarson4 merged commit 9b3275e into TransformerLensOrg:dev-4.x Sep 9, 2026
26 checks passed
@jlarson4

jlarson4 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Great work on this @ZacharyZcR! Thanks for tackling it!

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