credent007 commited on
Commit
2694076
·
verified ·
1 Parent(s): fe07d61

Update llm.py

Browse files
Files changed (1) hide show
  1. llm.py +8 -0
llm.py CHANGED
@@ -16,6 +16,14 @@ model = AutoModelForImageTextToText.from_pretrained(
16
  device_map="cuda"
17
  )
18
 
 
 
 
 
 
 
 
 
19
  # ✅ SYNC function (runs in thread)
20
  def execute_llm(model, processor, image, prompt: str):
21
  print("execute llm")
 
16
  device_map="cuda"
17
  )
18
 
19
+ print("CUDA available:", torch.cuda.is_available())
20
+ print("Model device:", model.device)
21
+
22
+ if torch.cuda.is_available():
23
+ print("GPU name:", torch.cuda.get_device_name(0))
24
+ print("Memory allocated:", torch.cuda.memory_allocated() / 1e9, "GB")
25
+
26
+ print("Device map:", model.hf_device_map)
27
  # ✅ SYNC function (runs in thread)
28
  def execute_llm(model, processor, image, prompt: str):
29
  print("execute llm")