tenseleyflow/sway / 57ba13e

Browse files

_param_id_mapping: silence mypy unused-ignore on hosts where safetensors ships py.typed

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
57ba13e7492834da94901701e81d8e6efc2980ad
Parents
b4e33f3
Tree
b458110

1 changed file

StatusFile+-
M src/dlm_sway/probes/_param_id_mapping.py 4 2
src/dlm_sway/probes/_param_id_mapping.pymodified
@@ -117,8 +117,10 @@ def map_param_ids_to_layers(adapter_dir: Path, num_params: int) -> LayerGrouping
117117
 
118118
     # Use ``safe_open`` so we never materialize the tensors — we only
119119
     # need the key list. Saves the 7+ MB read on a typical adapter.
120
-    # safetensors ships no py.typed; safe_open is untyped to mypy.
121
-    with safe_open(  # type: ignore[no-untyped-call]
120
+    # safetensors ships no py.typed in some versions and a py.typed
121
+    # marker in others — silence both states (untyped-call when the
122
+    # marker is missing, unused-ignore when it's present).
123
+    with safe_open(  # type: ignore[no-untyped-call,unused-ignore]
122124
         str(safetensors_path), framework="numpy", device="cpu"
123125
     ) as fh:
124126
         keys = list(fh.keys())