mirror of
https://github.com/allenai/olmocr.git
synced 2025-12-30 00:39:01 +00:00
More flexibility in dataloader dims
This commit is contained in:
parent
ff3d6aa61a
commit
ea0226c499
@ -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)
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user