From 2fa1b95045b27361722b982e91dee039b00a0f20 Mon Sep 17 00:00:00 2001 From: Michael Poutre Date: Sat, 18 Nov 2023 23:04:06 -0800 Subject: [PATCH] fix: Handle EOT as well as __PAD__ segments for pooler output EOT calc --- lib/fun_clip_stuff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fun_clip_stuff.py b/lib/fun_clip_stuff.py index b96f267..c81b3b4 100644 --- a/lib/fun_clip_stuff.py +++ b/lib/fun_clip_stuff.py @@ -219,7 +219,7 @@ class PrompLangCLIPTextTransformer(CLIPTextTransformer): if isinstance(seg_or_action, Action): idx += seg_or_action.token_length() else: - if seg_or_action.text == '__PAD__': + if seg_or_action.text == "__PAD__" or seg_or_action.text == "[EOT]": break # Is a segment, and isn't the pad segment