tenseleyflow/sway / bd7ce7c

Browse files

probes/_param_id_mapping: type-ignore on untyped safe_open call

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
bd7ce7c2acf7f831059942d836802b607e09db20
Parents
beea653
Tree
89efe6d

1 changed file

StatusFile+-
M src/dlm_sway/probes/_param_id_mapping.py 4 1
src/dlm_sway/probes/_param_id_mapping.pymodified
@@ -117,7 +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
-    with safe_open(str(safetensors_path), framework="numpy", device="cpu") as fh:
120
+    # safetensors ships no py.typed; safe_open is untyped to mypy.
121
+    with safe_open(  # type: ignore[no-untyped-call]
122
+        str(safetensors_path), framework="numpy", device="cpu"
123
+    ) as fh:
121124
         keys = list(fh.keys())
122125
     if not keys:
123126
         raise ParamMappingError(f"{safetensors_path}: no keys found")