More flexibility in dataloader dims

This commit is contained in:
Jake Poznanski 2024-09-24 19:47:13 -07:00
parent ff3d6aa61a
commit ea0226c499

View File

@ -29,7 +29,7 @@ def prepare_data_for_qwen2_training(example, processor):
# Right now, we are going to downsample to 1024 on the longest dimension, because
# 2048 as we passed to OpenAI is too large for training
width, height = main_image.size
assert max(width, height) == 2048
assert 1800 <= max(width, height) <= 2200
main_image = main_image.resize((width // 2, height // 2), Image.LANCZOS)
@ -120,7 +120,7 @@ def prepare_data_for_qwen2_inference(example, processor):
# Right now, we are going to downsample to 1024 on the longest dimension, because
# 2048 as we passed to OpenAI is too large for training
width, height = main_image.size
assert abs(max(width, height) - 2048) <= 2
assert 1800 <= max(width, height) <= 2200
main_image = main_image.resize((width // 2, height // 2), Image.LANCZOS)