From 20fb766ad291817a70ddfda866c1d1e0d5f4ac87 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Fri, 27 Mar 2026 20:56:52 +0100 Subject: [PATCH] fix: cast tensors to float32 before numpy() in feature save T5-Gemma outputs BFloat16 which numpy does not support. Cast all feature tensors with .float() before .numpy(). Co-Authored-By: Claude Sonnet 4.6 --- scripts/extract_features.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/extract_features.py b/scripts/extract_features.py index 9ed844b..d82aff5 100755 --- a/scripts/extract_features.py +++ b/scripts/extract_features.py @@ -123,11 +123,11 @@ def main(): print(f"[extract] Saving features to {args.output} ...", flush=True) np.savez( args.output, - video_features=video_features.cpu().numpy(), - global_video_features=global_video_features.cpu().numpy(), - text_features=text_features.cpu().numpy(), - global_text_features=global_text_features.cpu().numpy(), - sync_features=sync_features.cpu().numpy(), + video_features=video_features.cpu().float().numpy(), + global_video_features=global_video_features.cpu().float().numpy(), + text_features=text_features.cpu().float().numpy(), + global_text_features=global_text_features.cpu().float().numpy(), + sync_features=sync_features.cpu().float().numpy(), caption_cot=args.cot_text, duration=duration, )