Skip to content

fix some bugs#157

Merged
xming521 merged 2 commits intomasterfrom
dev
Jun 13, 2025
Merged

fix some bugs#157
xming521 merged 2 commits intomasterfrom
dev

Conversation

@xming521
Copy link
Copy Markdown
Owner

No description provided.

@xming521 xming521 changed the title refactor(config): 移除configV2,整合配置加载逻辑至config.py,更新相关引用 fix some bugs Jun 13, 2025
@xming521 xming521 merged commit 2defd56 into master Jun 13, 2025
2 checks passed
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Refactoring Breaks Dataset Selection and Training Configuration

The refactoring of weclone/utils/config.py removed critical, dynamic logic for train_sft and make_dataset argument types. This includes the absence of:

  • Conditional dataset selection: The system no longer falls back to "wechat-sft-with-history" when prompt_with_history is enabled but the dataset lacks history columns. It also fails to conditionally select "wechat-img-rec-sft" (with vision_api enabled) or "wechat-mllm-sft" (otherwise) when image modality is included. The removal of include_type from WCTrainSftConfig further compounds this.
  • Automatic training configuration: The do_train=True and output_dir settings are no longer automatically applied for training configurations.

This omission leads to incorrect dataset usage and improper training setups, causing potential failures or incorrect behavior.

weclone/utils/config.py#L49-L78

def create_config_by_arg_type(arg_type: str, wc_config: WcConfig) -> BaseModel:
"""根据参数类型创建对应的配置对象,添加可能用到的参数,添加的参数会在model_validator中删除"""
if arg_type == "cli_args":
return wc_config.cli_args
common_config = wc_config.common_args.model_dump()
if arg_type == "web_demo" or arg_type == "api_service":
config_dict = {**common_config, **wc_config.infer_args.model_dump()}
return WCInferConfig(**config_dict)
elif arg_type == "train_sft":
config_dict = {**common_config, **wc_config.train_sft_args.model_dump()}
return WCTrainSftConfig(**config_dict)
elif arg_type == "make_dataset":
make_dataset_config = wc_config.make_dataset_args.model_dump()
# ToDo 下面三个参数放到common里?
train_sft_args = wc_config.train_sft_args
extra_values = {
"dataset": train_sft_args.dataset,
"dataset_dir": train_sft_args.dataset_dir,
"cutoff_len": train_sft_args.cutoff_len,
}
config_dict = {**common_config, **make_dataset_config, **extra_values}
return WCMakeDatasetConfig(**config_dict)
else:
raise ValueError("暂不支持的参数类型")

Fix in Cursor


BugBot free trial expires on June 17, 2025
You have used $0.00 of your $0.00 spend limit so far. Manage your spend limit in the Cursor dashboard.

Was this report helpful? Give feedback by reacting with 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant