Fix h_crop and w_crop device
#58
by
lutzroeder
- opened
image_embedding_phi3_v.py
CHANGED
@@ -269,7 +269,7 @@ class Phi3ImageEmbedding(nn.Module):
|
|
269 |
"""
|
270 |
N, L, C = image_features.shape
|
271 |
assert L == 24 * 24 and C == 1024 and N % (h_crop * w_crop) == 0
|
272 |
-
num_images = N // (h_crop * w_crop)
|
273 |
H = int(L**0.5)
|
274 |
image_features_hd = (
|
275 |
image_features.reshape(N, H, H, C) # N, 24, 24, 1024
|
|
|
269 |
"""
|
270 |
N, L, C = image_features.shape
|
271 |
assert L == 24 * 24 and C == 1024 and N % (h_crop * w_crop) == 0
|
272 |
+
num_images = N // (int(h_crop) * int(w_crop))
|
273 |
H = int(L**0.5)
|
274 |
image_features_hd = (
|
275 |
image_features.reshape(N, H, H, C) # N, 24, 24, 1024
|