Skip to content

Commit

Permalink
List configs to list
Browse files Browse the repository at this point in the history
  • Loading branch information
jakep-allenai committed Oct 24, 2024
1 parent ffe470b commit f13d0a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pdelfin/train/dataprep.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def prepare_data_for_qwen2_training(example, processor, target_longest_image_dim
}


def batch_prepare_data_for_qwen2_training(batch, processor, target_longest_image_dim: int, target_anchor_text_len: int):
def batch_prepare_data_for_qwen2_training(batch, processor, target_longest_image_dim: list[int], target_anchor_text_len: list[int]):
# Process each example in the batch using the helper function
processed_examples = []
for i in range(len(batch["response"])):
Expand Down
8 changes: 4 additions & 4 deletions pdelfin/train/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def make_dataset(config: TrainConfig, processor: AutoProcessor) -> tuple[Dataset
partial(
batch_prepare_data_for_qwen2_training,
processor=processor,
target_longest_image_dim=target_longest_image_dim,
target_anchor_text_len=target_anchor_text_len,
target_longest_image_dim=list(target_longest_image_dim),
target_anchor_text_len=list(target_anchor_text_len),
)
)

Expand All @@ -86,8 +86,8 @@ def make_dataset(config: TrainConfig, processor: AutoProcessor) -> tuple[Dataset
partial(
batch_prepare_data_for_qwen2_training,
processor=processor,
target_longest_image_dim=source.target_longest_image_dim,
target_anchor_text_len=source.target_anchor_text_len,
target_longest_image_dim=list(source.target_longest_image_dim),
target_anchor_text_len=list(source.target_anchor_text_len),
)
)
for source in config.valid_data.sources
Expand Down

0 comments on commit f13d0a5

Please sign in to comment.