liuyizhang commited on
Commit
434a891
1 Parent(s): 57ec633

update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -1,6 +1,8 @@
1
 
2
  import subprocess, os, sys
3
 
 
 
4
  sys.path.insert(0, './GroundingDINO')
5
 
6
  result = subprocess.run(['pip', 'list'], check=True)
@@ -44,7 +46,7 @@ from huggingface_hub import hf_hub_download
44
  def get_device():
45
  from numba import cuda
46
  if cuda.is_available():
47
- device = cuda.get_current_device()
48
  else:
49
  device = 'cpu'
50
  return device
 
1
 
2
  import subprocess, os, sys
3
 
4
+ os.environ["CUDA_VISIBLE_DEVICES"] = "0"
5
+
6
  sys.path.insert(0, './GroundingDINO')
7
 
8
  result = subprocess.run(['pip', 'list'], check=True)
 
46
  def get_device():
47
  from numba import cuda
48
  if cuda.is_available():
49
+ device = 'cuda:0' # cuda.get_current_device()
50
  else:
51
  device = 'cpu'
52
  return device