Skip to content

Commit

Permalink
ci : reduce severity of unused Pyright ignore comments (ggerganov#9697)
Browse files Browse the repository at this point in the history
  • Loading branch information
compilade authored and dsx1986 committed Oct 29, 2024
1 parent 5d4e1c1 commit dea51e1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/python-type-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ on:
push:
paths:
- '.github/workflows/python-type-check.yml'
- 'pyrightconfig.json'
- '**.py'
- '**/requirements*.txt'
pull_request:
paths:
- '.github/workflows/python-type-check.yml'
- 'pyrightconfig.json'
- '**.py'
- '**/requirements*.txt'

Expand All @@ -33,6 +35,6 @@ jobs:
- name: Type-check with Pyright
uses: jakebailey/pyright-action@v2
with:
version: 1.1.370
version: 1.1.382
level: warning
warnings: true
4 changes: 2 additions & 2 deletions examples/llava/convert_image_encoder_to_gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def bytes_to_unicode():


if has_llava_projector:
model.vision_model.encoder.layers.pop(-1) # pyright: ignore[reportAttributeAccessIssue]
model.vision_model.encoder.layers.pop(-1)
projector = torch.load(args.llava_projector)
for name, data in projector.items():
name = get_tensor_name(name)
Expand All @@ -288,7 +288,7 @@ def bytes_to_unicode():

print("Projector tensors added\n")

state_dict = model.state_dict() # pyright: ignore[reportAttributeAccessIssue]
state_dict = model.state_dict()
for name, data in state_dict.items():
if should_skip_tensor(name, has_text_encoder, has_vision_encoder, has_llava_projector):
# we don't need this
Expand Down
3 changes: 2 additions & 1 deletion pyrightconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"reportUnusedImport": "warning",
"reportDuplicateImport": "error",
"reportDeprecated": "warning",
"reportUnnecessaryTypeIgnoreComment": "warning",
"reportUnnecessaryTypeIgnoreComment": "information",
"disableBytesTypePromotions": false, // TODO: change once Python 3.12 is the minimum
"executionEnvironments": [
{
// TODO: make this version override work correctly
Expand Down

0 comments on commit dea51e1

Please sign in to comment.