diff --git a/llava/conversation.py b/llava/conversation.py index 00c56867d..e222768a8 100644 --- a/llava/conversation.py +++ b/llava/conversation.py @@ -133,7 +133,7 @@ def expand2square(pil_img, background_color=(122, 116, 104)): if max(image.size) > max_len: max_hw, min_hw = max(image.size), min(image.size) aspect_ratio = max_hw / min_hw - shortest_edge = int(min(max_len / aspect_ratio, min_len, min_hw)) + shortest_edge = int(max_len / aspect_ratio) longest_edge = int(shortest_edge * aspect_ratio) W, H = image.size if H > W: diff --git a/llava/train/train.py b/llava/train/train.py index 477c668b6..558f69e31 100644 --- a/llava/train/train.py +++ b/llava/train/train.py @@ -143,7 +143,7 @@ def get_peft_state_maybe_zero_3(named_params, bias): lora_bias_names.add(bias_name) elif "bias" in k: maybe_lora_bias[k] = t - for k, t in maybe_lora_bias: + for bias_name, t in maybe_lora_bias: if bias_name in lora_bias_names: to_return[bias_name] = t else: