Skip to content

Commit 3964a58

Browse files
committed
Refactor time_instruction formatting in srt_api.py for improved readability
1 parent 146f9e4 commit 3964a58

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lmms_eval/models/simple/srt_api.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@ async def generate(self, request):
182182
imgs = None
183183
break
184184

185-
time_instruction = f"The video lasts for {video_time:.2f} seconds, and {len(frames)} frames are uniformly sampled from it. These frames are located at {frame_time}.Please answer the following questions related to this video."
185+
time_instruction = (
186+
f"The video lasts for {video_time:.2f} seconds, and {len(frames)} frames are uniformly sampled from it. These frames are located at {frame_time}.Please answer the following questions related to this video."
187+
)
186188
if self.add_time_instruction and self.modality == "video" and imgs is not None:
187189
contexts = f"{time_instruction}\n{contexts}"
188190
else:
@@ -243,7 +245,9 @@ def generate_sync(self, request):
243245
imgs = None
244246
break
245247

246-
time_instruction = f"The video lasts for {video_time:.2f} seconds, and {len(frames)} frames are uniformly sampled from it. These frames are located at {frame_time}.Please answer the following questions related to this video."
248+
time_instruction = (
249+
f"The video lasts for {video_time:.2f} seconds, and {len(frames)} frames are uniformly sampled from it. These frames are located at {frame_time}.Please answer the following questions related to this video."
250+
)
247251
if self.add_time_instruction and self.modality == "video" and imgs is not None:
248252
contexts = f"{time_instruction}\n{contexts}"
249253
else:

0 commit comments

Comments
 (0)