Skip to content

Commit 511636d

Browse files
authored
ci : reduce severity of unused Pyright ignore comments (#9697)
1 parent 08a43d0 commit 511636d

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.github/workflows/python-type-check.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ on:
44
push:
55
paths:
66
- '.github/workflows/python-type-check.yml'
7+
- 'pyrightconfig.json'
78
- '**.py'
89
- '**/requirements*.txt'
910
pull_request:
1011
paths:
1112
- '.github/workflows/python-type-check.yml'
13+
- 'pyrightconfig.json'
1214
- '**.py'
1315
- '**/requirements*.txt'
1416

@@ -33,6 +35,6 @@ jobs:
3335
- name: Type-check with Pyright
3436
uses: jakebailey/pyright-action@v2
3537
with:
36-
version: 1.1.370
38+
version: 1.1.382
3739
level: warning
3840
warnings: true

examples/llava/convert_image_encoder_to_gguf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def bytes_to_unicode():
274274

275275

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

289289
print("Projector tensors added\n")
290290

291-
state_dict = model.state_dict() # pyright: ignore[reportAttributeAccessIssue]
291+
state_dict = model.state_dict()
292292
for name, data in state_dict.items():
293293
if should_skip_tensor(name, has_text_encoder, has_vision_encoder, has_llava_projector):
294294
# we don't need this

pyrightconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"reportUnusedImport": "warning",
66
"reportDuplicateImport": "error",
77
"reportDeprecated": "warning",
8-
"reportUnnecessaryTypeIgnoreComment": "warning",
8+
"reportUnnecessaryTypeIgnoreComment": "information",
9+
"disableBytesTypePromotions": false, // TODO: change once Python 3.12 is the minimum
910
"executionEnvironments": [
1011
{
1112
// TODO: make this version override work correctly

0 commit comments

Comments
 (0)