Shengxiao0709 commited on
Commit
4b238e9
·
verified ·
1 Parent(s): 6f0b17b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py CHANGED
@@ -5,6 +5,20 @@ import numpy as np
5
 
6
  # 你已有的推理代码
7
  from inference import load_model, get_embedding, run
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
  # ---- 仅加载一次模型 ----
10
  model, device = load_model("medsam_vit_b.pth")
 
5
 
6
  # 你已有的推理代码
7
  from inference import load_model, get_embedding, run
8
+ import torch
9
+ import os
10
+
11
+ print("=== [DEBUG] Torch Info ===")
12
+ print("Torch version:", torch.__version__)
13
+ print("CUDA available:", torch.cuda.is_available())
14
+ if torch.cuda.is_available():
15
+ print("CUDA device count:", torch.cuda.device_count())
16
+ print("CUDA device name:", torch.cuda.get_device_name(0))
17
+ print("CUDA version (torch):", torch.version.cuda)
18
+ print("cuDNN version:", torch.backends.cudnn.version())
19
+ else:
20
+ print("Running on CPU only")
21
+ print("==========================")
22
 
23
  # ---- 仅加载一次模型 ----
24
  model, device = load_model("medsam_vit_b.pth")