Spaces:
Runtime error
Runtime error
Update model.py
Browse files
model.py
CHANGED
|
@@ -88,7 +88,7 @@ class Model:
|
|
| 88 |
return t5_model
|
| 89 |
|
| 90 |
@torch.no_grad()
|
| 91 |
-
@spaces.GPU(enable_queue=True)
|
| 92 |
def process_edge(
|
| 93 |
self,
|
| 94 |
image: np.ndarray,
|
|
@@ -188,7 +188,7 @@ class Model:
|
|
| 188 |
return samples
|
| 189 |
|
| 190 |
@torch.no_grad()
|
| 191 |
-
@spaces.GPU(enable_queue=True)
|
| 192 |
def process_depth(
|
| 193 |
self,
|
| 194 |
image: np.ndarray,
|
|
@@ -237,7 +237,7 @@ class Model:
|
|
| 237 |
for idx, (caption_emb,
|
| 238 |
emb_mask) in enumerate(zip(caption_embs, emb_masks)):
|
| 239 |
valid_num = int(emb_mask.sum().item())
|
| 240 |
-
print(f'
|
| 241 |
new_caption_emb = torch.cat(
|
| 242 |
[caption_emb[valid_num:], caption_emb[:valid_num]])
|
| 243 |
new_caption_embs.append(new_caption_emb)
|
|
|
|
| 88 |
return t5_model
|
| 89 |
|
| 90 |
@torch.no_grad()
|
| 91 |
+
@spaces.GPU(enable_queue=True, duration=120)
|
| 92 |
def process_edge(
|
| 93 |
self,
|
| 94 |
image: np.ndarray,
|
|
|
|
| 188 |
return samples
|
| 189 |
|
| 190 |
@torch.no_grad()
|
| 191 |
+
@spaces.GPU(enable_queue=True, duration=120)
|
| 192 |
def process_depth(
|
| 193 |
self,
|
| 194 |
image: np.ndarray,
|
|
|
|
| 237 |
for idx, (caption_emb,
|
| 238 |
emb_mask) in enumerate(zip(caption_embs, emb_masks)):
|
| 239 |
valid_num = int(emb_mask.sum().item())
|
| 240 |
+
print(f'prompt {idx} token len: {valid_num}')
|
| 241 |
new_caption_emb = torch.cat(
|
| 242 |
[caption_emb[valid_num:], caption_emb[:valid_num]])
|
| 243 |
new_caption_embs.append(new_caption_emb)
|