test
Browse files
app.py
CHANGED
@@ -88,16 +88,12 @@ model_option = gr.Radio(options, value="dino16",
|
|
88 |
label='Choose a backbone to upsample')
|
89 |
|
90 |
|
91 |
-
def
|
92 |
try:
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
version = line.split()[-1]
|
98 |
-
return f"/usr/local/cuda-{version.split('.')[0]}.{version.split('.')[1]}"
|
99 |
-
except Exception as e:
|
100 |
-
print(f"Error finding CUDA_HOME: {e}")
|
101 |
return None
|
102 |
|
103 |
@spaces.GPU(duration=120)
|
@@ -107,10 +103,11 @@ def upsample_features(image, model_option):
|
|
107 |
from torch.utils.cpp_extension import BuildExtension, CUDAExtension, CppExtension
|
108 |
|
109 |
print(subprocess.check_output(['ls', '/usr/local/']).decode())
|
110 |
-
|
111 |
-
if
|
112 |
-
print(
|
113 |
-
|
|
|
114 |
|
115 |
setup(
|
116 |
name='featup',
|
|
|
88 |
label='Choose a backbone to upsample')
|
89 |
|
90 |
|
91 |
+
def find_nvcc():
|
92 |
try:
|
93 |
+
result = subprocess.check_output(['find', '/', '-name', 'nvcc', '2>/dev/null'], stderr=subprocess.STDOUT, text=True, shell=True)
|
94 |
+
return result.strip()
|
95 |
+
except subprocess.CalledProcessError as e:
|
96 |
+
print(f"Error occurred: {e}")
|
|
|
|
|
|
|
|
|
97 |
return None
|
98 |
|
99 |
@spaces.GPU(duration=120)
|
|
|
103 |
from torch.utils.cpp_extension import BuildExtension, CUDAExtension, CppExtension
|
104 |
|
105 |
print(subprocess.check_output(['ls', '/usr/local/']).decode())
|
106 |
+
nvcc_path = find_nvcc()
|
107 |
+
if nvcc_path:
|
108 |
+
print(f"CUDA 'nvcc' found at: {nvcc_path}")
|
109 |
+
else:
|
110 |
+
print("CUDA 'nvcc' not found.")
|
111 |
|
112 |
setup(
|
113 |
name='featup',
|