[Bugfix] Fix corner case of sparse embedding (#33886)

Signed-off-by: wang.yuqi <yuqi.wang@daocloud.io>
This commit is contained in:
wang.yuqi
2026-02-05 18:51:22 +08:00
committed by GitHub
parent 7bd42e609d
commit 1c3a221d3b
2 changed files with 11 additions and 1 deletions

View File

@@ -165,7 +165,7 @@ class BOSEOSFilter(Pooler):
pooled_data = pooled_data[1:]
if token_ids[-1] == self.eos_token_id:
pooled_data = pooled_data[:-1]
pooled_outputs[i] = pooled_data.squeeze()
pooled_outputs[i] = pooled_data.squeeze(-1)
return pooled_outputs