Spaces:
Paused
Paused
Benjamin Auquite commited on
Avoid ZeroGPU zeros_like kernel
Browse files
src/trellis2/pipelines/trellis2_image_to_3d.py
CHANGED
|
@@ -236,7 +236,16 @@ class Trellis2ImageTo3DPipeline(Pipeline):
|
|
| 236 |
self.image_cond_model.cpu()
|
| 237 |
if not include_neg_cond:
|
| 238 |
return {"cond": cond}
|
| 239 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 240 |
return {
|
| 241 |
"cond": cond,
|
| 242 |
"neg_cond": neg_cond,
|
|
|
|
| 236 |
self.image_cond_model.cpu()
|
| 237 |
if not include_neg_cond:
|
| 238 |
return {"cond": cond}
|
| 239 |
+
try:
|
| 240 |
+
neg_cond = torch.zeros_like(cond)
|
| 241 |
+
except RuntimeError as exc:
|
| 242 |
+
kernel_image_error = (
|
| 243 |
+
"no kernel image is available for execution on the device"
|
| 244 |
+
in str(exc).lower()
|
| 245 |
+
)
|
| 246 |
+
if not kernel_image_error:
|
| 247 |
+
raise
|
| 248 |
+
neg_cond = torch.zeros(cond.shape, dtype=cond.dtype).to(cond.device)
|
| 249 |
return {
|
| 250 |
"cond": cond,
|
| 251 |
"neg_cond": neg_cond,
|