Spaces:
Runtime error
Runtime error
Commit
·
27dab1f
1
Parent(s):
88c85c4
Update app.py
Browse files
app.py
CHANGED
@@ -139,7 +139,7 @@ def compute_image_state(image):
|
|
139 |
image = image.to(device)
|
140 |
image_features = visual_encoder.encode_images(image.unsqueeze(0)).squeeze(0) # [L, D]
|
141 |
# apply layer norm to image feature, very important
|
142 |
-
image_features = F.layer_norm(image_features,
|
143 |
(image_features.shape[-1],),
|
144 |
weight=model.w['blocks.0.ln0.weight'],
|
145 |
bias=model.w['blocks.0.ln0.bias'])
|
|
|
139 |
image = image.to(device)
|
140 |
image_features = visual_encoder.encode_images(image.unsqueeze(0)).squeeze(0) # [L, D]
|
141 |
# apply layer norm to image feature, very important
|
142 |
+
image_features = F.layer_norm(image_features.to(torch.float32),
|
143 |
(image_features.shape[-1],),
|
144 |
weight=model.w['blocks.0.ln0.weight'],
|
145 |
bias=model.w['blocks.0.ln0.bias'])
|