From ea0226c4991ce99c5c50ea34ee8845bdee467e58 Mon Sep 17 00:00:00 2001 From: Jake Poznanski Date: Tue, 24 Sep 2024 19:47:13 -0700 Subject: [PATCH] More flexibility in dataloader dims --- pdelfin/train/dataprep.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdelfin/train/dataprep.py b/pdelfin/train/dataprep.py index 9d5dd9c..b05ca61 100644 --- a/pdelfin/train/dataprep.py +++ b/pdelfin/train/dataprep.py @@ -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)