Skip to content

Commit

Permalink
Fix Bug: key_text do not update correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
shiweijiezero authored Apr 18, 2024
1 parent 094440b commit eee0d47
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions data_juicer/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,10 @@ def init_configs(args=None):

try:
cfg = parser.parse_args(args=args)
cfg = update_op_process(cfg, parser)

cfg = init_setup_from_cfg(cfg)
cfg = update_op_process(cfg, parser)


# copy the config file into the work directory
config_backup(cfg)
Expand Down Expand Up @@ -422,16 +424,15 @@ def init_setup_from_cfg(cfg):
'audio_key': cfg.audio_key,
'video_key': cfg.video_key,
}
elif args['text_key'] is None:
args['text_key'] = text_key
args['image_key'] = cfg.image_key
args['audio_key'] = cfg.audio_key
args['video_key'] = cfg.video_key
if text_key:
args['text_key'] = text_key
args['image_key'] = cfg.image_key
args['audio_key'] = cfg.audio_key
args['video_key'] = cfg.video_key
else:
if 'text_key' not in args or args['text_key'] is None:
args['text_key'] = text_key
if 'image_key' not in args or args['image_key'] is None:
args['image_key'] = cfg.image_key
if 'audio_key' not in args or args['audio_key'] is None:
args['audio_key'] = cfg.audio_key
if 'video_key' not in args or args['video_key'] is None:
args['video_key'] = cfg.video_key
op[op_name] = args

return cfg
Expand Down

0 comments on commit eee0d47

Please sign in to comment.