Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(v3) Draft PR: add Pyright static typing to hook_points.py #590 #607

Merged
merged 28 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1aae47e
Initial Commit (add pyright + test by adding few annotations)
starship006 Nov 21, 2023
1fffa0c
Slightly more typing added
starship006 Nov 21, 2023
5ded3a3
more typing
starship006 Nov 21, 2023
7fd5cba
Additional typing
starship006 Nov 24, 2023
4c974f6
Merge pull request #1 from neelnanda-io/main
starship006 Dec 6, 2023
ef313a9
Completed typing for hook_points.py file
starship006 Dec 6, 2023
f7e40ae
todo clarifications
starship006 Dec 11, 2023
583c421
Merge branch 'main' of https://github.com/neelnanda-io/TransformerLens
starship006 Dec 11, 2023
95f60eb
formatting changes to hook_points.py
starship006 Dec 11, 2023
fc0e08b
Apply some suggestions from code review
starship006 Mar 12, 2024
53ce9b8
Added typing for Literals and changed some assertions to if statements
starship006 Mar 12, 2024
cceb9ab
formatting
starship006 Mar 12, 2024
7e076fb
Merge branch 'main' into starship006/main
bryce13950 Apr 27, 2024
317cd58
Merge pull request #3 from Lingwave/pyright-hook_points
starship006 May 5, 2024
fabc42f
update to accout for merged code
starship006 May 5, 2024
6887cf9
Merge branch 'TransformerLensOrg:main' into main
starship006 May 11, 2024
95e0193
small typing issue
starship006 May 11, 2024
5b95176
changing hookfunction protocol + more assertions
starship006 May 11, 2024
52686f7
change the slice input
starship006 May 11, 2024
f51ea95
change from isinstance to callable checks
starship006 May 11, 2024
0fd85b9
fix: Update Gemma to reflect upstream HF changes (#596)
cmathw May 15, 2024
5a374ec
allow user to force trust_remote_code=true via from_pretrained kwargs…
Butanium May 15, 2024
1c83f1c
change + revert HookFunctionProtocol
starship006 May 22, 2024
f47a1a5
Merge branch 'TransformerLensOrg:main' into main
starship006 May 22, 2024
8ae08f4
format
starship006 May 22, 2024
a6146ca
module_output is now just a tensor
starship006 May 22, 2024
907706d
Merge branch 'dev' into renamed_main
bryce13950 May 23, 2024
785f08f
set module ouput to be any type
bryce13950 May 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,68 @@
[build-system]
build-backend="poetry.core.masonry.api"
requires=["poetry-core"]

[tool.pyright]
# All rules apart from base are shown explicitly below
deprecateTypingAliases=true
disableBytesTypePromotions=true
exclude = [
"*/**/*.py",
"!/transformer_lens/hook_points.py"
]
reportAssertAlwaysTrue=true
reportConstantRedefinition=true
reportDeprecated=true
reportDuplicateImport=true
reportFunctionMemberAccess=true
reportGeneralTypeIssues=true
reportIncompatibleMethodOverride=true
reportIncompatibleVariableOverride=true
reportIncompleteStub=true
reportInconsistentConstructor=true
reportInvalidStringEscapeSequence=true
reportInvalidStubStatement=true
reportInvalidTypeVarUse=true
reportMatchNotExhaustive=true
reportMissingParameterType=true
reportMissingTypeArgument=false
reportMissingTypeStubs=false
reportOptionalCall=true
reportOptionalContextManager=true
reportOptionalIterable=true
reportOptionalMemberAccess=true
reportOptionalOperand=true
reportOptionalSubscript=true
reportOverlappingOverload=true
reportPrivateImportUsage=true
reportPrivateUsage=true
reportSelfClsParameterName=true
reportTypeCommentUsage=true
reportTypedDictNotRequiredAccess=true
reportUnboundVariable=true
reportUnknownArgumentType=false
reportUnknownLambdaType=true
reportUnknownMemberType=false
reportUnknownParameterType=false
reportUnknownVariableType=false
reportUnnecessaryCast=true
reportUnnecessaryComparison=true
reportUnnecessaryContains=true
reportUnnecessaryIsInstance=true
reportUnsupportedDunderAll=true
reportUntypedBaseClass=true
reportUntypedClassDecorator=true
reportUntypedFunctionDecorator=true
reportUntypedNamedTuple=true
reportUnusedClass=true
reportUnusedCoroutine=true
reportUnusedExpression=true
reportUnusedFunction=true
reportUnusedImport=true
reportUnusedVariable=true
reportWildcardImportFromLibrary=true
strictDictionaryInference=true
strictListInference=true
strictParameterNoneValue=true
strictSetInference=true

Loading
Loading