()
| 357 | |
| 358 | |
| 359 | def _clear_cuda_cache() -> None: |
| 360 | if torch is None or not hasattr(torch, "cuda"): |
| 361 | return |
| 362 | try: |
| 363 | if torch.cuda.is_available(): |
| 364 | torch.cuda.empty_cache() |
| 365 | except Exception: |
| 366 | pass |
| 367 | |
| 368 | |
| 369 | def _resolve_local_llm_device(force_device: Optional[str] = None) -> str: |
no outgoing calls
no test coverage detected