MCPcopy Create free account
hub / github.com/1038lab/ComfyUI-FireRedTTS / check_gpu_memory

Function check_gpu_memory

AILab_FireRedTTS.py:55–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53 torch.cuda.synchronize()
54
55def check_gpu_memory():
56 if device == "cuda" and torch.cuda.is_available():
57 total_memory = torch.cuda.get_device_properties(0).total_memory / 1024**3
58 allocated_memory = torch.cuda.memory_allocated(0) / 1024**3
59 cached_memory = torch.cuda.memory_reserved(0) / 1024**3
60 print(f"[INFO] GPU Memory - Total: {total_memory:.1f}GB, Allocated: {allocated_memory:.1f}GB, Cached: {cached_memory:.1f}GB")
61 return total_memory, allocated_memory, cached_memory
62 return None, None, None
63
64def safe_generate_with_fallback(model, generate_func, *args, **kwargs):
65 try:

Callers 1

get_dialogue_modelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected