【Qwen】DataArguments说明

DataArguments

Holds all configuration options for data loading and preprocessing in Qwen-VL fine-tuning. Passed as data_args after parsing from the command line (e.g. via HfArgumentParser) and used by make_supervised_data_module to build the dataset and collator.


Attributes

Name Type Default Description
dataset_use str "" Comma-separated dataset names or paths. Resolved via data_list() to get annotation_path and data_path for LazySupervisedDataset.
data_flatten bool False If True, use FlattenedDataCollatorForSupervisedDataset and packed sequences; otherwise use DataCollatorForSupervisedDataset.
data_packing bool False If True, enable sequence packing in the dataset (_get_packed_item).
base_interval int 2 Base interval used in packing or flattening (exact meaning depends on data_list / collator implementation).
max_pixels int 28 * 28 * 576 Maximum number of pixels (e.g. H * W) for an image. Written to the image processor's size["longest_edge"] / max_pixels.
min_pixels int 28 * 28 * 16 Minimum number of pixels for an image. Written to the image processor's size["shortest_edge"] / min_pixels.
video_max_frames int or None 8 Maximum number of sampled frames per video (used by video processor if present).
video_min_frames int or None 4 Minimum number of sampled frames per video.
video_max_pixels int 1024 * 28 * 28 Maximum total pixels for video frames. Set on the video processor when available.
video_min_pixels int 256 * 28 * 28 Minimum total pixels for video frames.
video_fps float 2 Frames per second used when sampling video.

Usage

Parsed together with ModelArguments and TrainingArguments in the training script:

python 复制代码
parser = transformers.HfArgumentParser(
    (ModelArguments, DataArguments, TrainingArguments)
)
model_args, data_args, training_args = parser.parse_args_into_dataclasses()

data_module = make_supervised_data_module(processor, data_args=data_args)

Command-line example:

bash 复制代码
python qwenvl/train/train_qwen.py \
    --dataset_use "path/to/annotations.json" \
    --data_flatten True \
    --max_pixels 50176 \
    --min_pixels 784

Note

  • DataArguments is defined in qwenvl/train/argument.py and is a dataclass. The parsed instance is typically named data_args in the training pipeline.
  • The image processor's pixel limits are updated in update_processor_pixels(processor, data_args) using max_pixels and min_pixels.
相关推荐
哥布林学者14 小时前
高光谱成像(一)高光谱图像
机器学习·高光谱成像
地平线开发者14 小时前
SparseDrive 模型导出与性能优化实战
算法·自动驾驶
董董灿是个攻城狮14 小时前
大模型连载2:初步认识 tokenizer 的过程
算法
地平线开发者14 小时前
地平线 VP 接口工程实践(一):hbVPRoiResize 接口功能、使用约束与典型问题总结
算法·自动驾驶
罗西的思考15 小时前
AI Agent框架探秘:拆解 OpenHands(10)--- Runtime
人工智能·算法·机器学习
HXhlx18 小时前
CART决策树基本原理
算法·机器学习
Wect18 小时前
LeetCode 210. 课程表 II 题解:Kahn算法+DFS 双解法精讲
前端·算法·typescript
颜酱19 小时前
单调队列:滑动窗口极值问题的最优解(通用模板版)
javascript·后端·算法
程序员打怪兽1 天前
详解Visual Transformer (ViT)网络模型
深度学习
Gorway1 天前
解析残差网络 (ResNet)
算法