Commit
Β·
8d03054
1
Parent(s):
f4fdcc9
debug
Browse files
app.py
CHANGED
@@ -75,10 +75,6 @@ def check_gpu():
|
|
75 |
subprocess.run(['nvidia-smi']) # Test if CUDA is available
|
76 |
print(f"torch.cuda.is_available:{torch.cuda.is_available()}")
|
77 |
print("Device count:", torch.cuda.device_count())
|
78 |
-
# test nvdiffrast
|
79 |
-
import nvdiffrast.torch as dr
|
80 |
-
dr.RasterizeCudaContext(device="cuda:0")
|
81 |
-
print("nvdiffrast initialized successfully")
|
82 |
|
83 |
# Only check GPU in non-UI debug mode
|
84 |
if not UI_ONLY_MODE:
|
@@ -187,6 +183,11 @@ if UI_ONLY_MODE:
|
|
187 |
else:
|
188 |
@spaces.GPU
|
189 |
def text_to_detailed(prompt, seed=None):
|
|
|
|
|
|
|
|
|
|
|
190 |
print(f"torch.cuda.is_available():{torch.cuda.is_available()}")
|
191 |
# print(f"Before text_to_detailed: {torch.cuda.memory_allocated() / 1024**3} GB")
|
192 |
return k3d_wrapper.get_detailed_prompt(prompt, seed)
|
|
|
75 |
subprocess.run(['nvidia-smi']) # Test if CUDA is available
|
76 |
print(f"torch.cuda.is_available:{torch.cuda.is_available()}")
|
77 |
print("Device count:", torch.cuda.device_count())
|
|
|
|
|
|
|
|
|
78 |
|
79 |
# Only check GPU in non-UI debug mode
|
80 |
if not UI_ONLY_MODE:
|
|
|
183 |
else:
|
184 |
@spaces.GPU
|
185 |
def text_to_detailed(prompt, seed=None):
|
186 |
+
# test nvdiffrast
|
187 |
+
import nvdiffrast.torch as dr
|
188 |
+
dr.RasterizeCudaContext(device="cuda:0")
|
189 |
+
print("nvdiffrast initialized successfully")
|
190 |
+
|
191 |
print(f"torch.cuda.is_available():{torch.cuda.is_available()}")
|
192 |
# print(f"Before text_to_detailed: {torch.cuda.memory_allocated() / 1024**3} GB")
|
193 |
return k3d_wrapper.get_detailed_prompt(prompt, seed)
|