From 829a0c70287fad4ede62a1ae73e83548445eb45d Mon Sep 17 00:00:00 2001 From: "lielin.hyl" Date: Fri, 27 Dec 2024 15:32:57 +0800 Subject: [PATCH] * fix bugs in video_captioning_from_summarizer_mapper due to reorganization of meta and tags --- .../mapper/video_captioning_from_summarizer_mapper.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/data_juicer/ops/mapper/video_captioning_from_summarizer_mapper.py b/data_juicer/ops/mapper/video_captioning_from_summarizer_mapper.py index 67eb7e234..ca095af33 100644 --- a/data_juicer/ops/mapper/video_captioning_from_summarizer_mapper.py +++ b/data_juicer/ops/mapper/video_captioning_from_summarizer_mapper.py @@ -197,17 +197,19 @@ def _process_single_sample(self, sample, rank=None): temp_sample = { self.text_key: chunk, self.video_key: loaded_video_keys[offset:offset + vid_count], + Fields.meta: {} } captioned_text_list = [] # tag ops for op in self.tag_op_list: temp_sample = op.process(temp_sample, rank=rank) - if Fields.video_audio_tags in temp_sample: + if Fields.video_audio_tags in temp_sample[Fields.meta]: captioned_text_list.extend( - temp_sample[Fields.video_audio_tags]) - if Fields.video_frame_tags in temp_sample: - for tag_list in temp_sample[Fields.video_frame_tags]: + temp_sample[Fields.meta][Fields.video_audio_tags]) + if Fields.video_frame_tags in temp_sample[Fields.meta]: + for tag_list in temp_sample[Fields.meta][ + Fields.video_frame_tags]: captioned_text_list.extend(tag_list[self.keep_tag_num]) # cap ops for op in self.cap_op_list: