prithivMLmods commited on
Commit
be1a209
·
verified ·
1 Parent(s): 87f414d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -29,6 +29,18 @@ MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "4096"))
29
 
30
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
31
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  # Load Nanonets-OCR-s
33
  MODEL_ID_V = "nanonets/Nanonets-OCR-s"
34
  processor_v = AutoProcessor.from_pretrained(MODEL_ID_V, trust_remote_code=True)
 
29
 
30
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
31
 
32
+ print("CUDA_VISIBLE_DEVICES=", os.environ.get("CUDA_VISIBLE_DEVICES"))
33
+ print("torch.__version__ =", torch.__version__)
34
+ print("torch.version.cuda =", torch.version.cuda)
35
+ print("cuda available:", torch.cuda.is_available())
36
+ print("cuda device count:", torch.cuda.device_count())
37
+ if torch.cuda.is_available():
38
+ print("current device:", torch.cuda.current_device())
39
+ print("device name:", torch.cuda.get_device_name(torch.cuda.current_device()))
40
+
41
+ print("Using device:", device)
42
+
43
+ # --- Model Loading ---
44
  # Load Nanonets-OCR-s
45
  MODEL_ID_V = "nanonets/Nanonets-OCR-s"
46
  processor_v = AutoProcessor.from_pretrained(MODEL_ID_V, trust_remote_code=True)