Skip to content

Commit 91afae3

Browse files
committed
Ignore type checks for torch.cuda.stream
Add `# type: ignore` to two usages of `torch.cuda.stream` (in trt_base.py and vila_processor.py) to suppress static type-checker complaints about the CUDA stream context manager. This is a no-op at runtime and only affects linting/type-checking to keep CI clean.
1 parent 6dd9ad4 commit 91afae3

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/om1_vlm/anonymizationSys/face_recog_stream/trt_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def _to_gpu(self, host_np: np.ndarray) -> torch.Tensor:
110110
111111
Use ``tensor.data_ptr()`` to get the raw pointer for TRT.
112112
"""
113-
with torch.cuda.stream(self._torch_stream):
113+
with torch.cuda.stream(self._torch_stream): # type: ignore
114114
return torch.from_numpy(host_np).cuda(non_blocking=True)
115115

116116
def _empty_gpu(self, shape, dtype=torch.float32) -> torch.Tensor:

src/om1_vlm/vila_vlm/vila_processor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def generate_with_images(self, images: List[bytes], prompt: str):
211211
with self.model_lock:
212212
# Set the current CUDA stream
213213
if self.cuda_stream:
214-
with torch.cuda.stream(self.cuda_stream):
214+
with torch.cuda.stream(self.cuda_stream): # type: ignore
215215
# Add explicit CUDA synchronization before processing
216216
if torch.cuda.is_available():
217217
torch.cuda.synchronize()

0 commit comments

Comments
 (0)