]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
ci : reduce severity of unused Pyright ignore comments (#9697)
authorcompilade <redacted>
Mon, 30 Sep 2024 18:13:16 +0000 (14:13 -0400)
committerGitHub <redacted>
Mon, 30 Sep 2024 18:13:16 +0000 (14:13 -0400)
.github/workflows/python-type-check.yml
examples/llava/convert_image_encoder_to_gguf.py
pyrightconfig.json

index e5ff5e6d792cb3fd05534f912e43bbb476f31bf0..373bb601020b25597408efdb4bcbf31dc4562a18 100644 (file)
@@ -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'
 
@@ -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
index 36f6b92fbd46ebb31be0db3f890bf390f1d8829b..4fa1d6ceae1bb5ea251697dceab8a724cea9e211 100644 (file)
@@ -274,7 +274,7 @@ fout.add_bool("clip.use_gelu", use_gelu)
 
 
 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)
@@ -288,7 +288,7 @@ if has_llava_projector:
 
     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
index 6016f4b6d0120459c94a2e898b2fe136b648773a..9acbbeb78a2edbb589309b19ff9d99d42e85742c 100644 (file)
@@ -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