Update internvl_chat.py
Browse files- internvl_chat.py +5 -1
internvl_chat.py
CHANGED
|
@@ -97,7 +97,11 @@ def dynamic_preprocess2(image, min_num=1, max_num=6, image_size=448, use_thumbna
|
|
| 97 |
new_target_ratios = []
|
| 98 |
if prior_aspect_ratio is not None:
|
| 99 |
for i in target_ratios:
|
| 100 |
-
if
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
new_target_ratios.append(i)
|
| 102 |
else:
|
| 103 |
continue
|
|
|
|
| 97 |
new_target_ratios = []
|
| 98 |
if prior_aspect_ratio is not None:
|
| 99 |
for i in target_ratios:
|
| 100 |
+
if i[0]==1 and prior_aspect_ratio[1]%i[1] !=0:
|
| 101 |
+
new_target_ratios.append(i)
|
| 102 |
+
elif i[1]==1 and prior_aspect_ratio[0]%i[0] !=0:
|
| 103 |
+
new_target_ratios.append(i)
|
| 104 |
+
elif prior_aspect_ratio[0]%i[0] !=0 or prior_aspect_ratio[1]%i[1] !=0:
|
| 105 |
new_target_ratios.append(i)
|
| 106 |
else:
|
| 107 |
continue
|