diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-09-15 12:13:06 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-09-15 12:13:06 +0000 |
commit | d4dc4c1c633e27e7cb1a7208e8c39376dbee2d97 (patch) | |
tree | 444fac4512ecf24a27592690335837c99d5ec129 | |
parent | d7f73788285cacb0af7490ad20fedabb1aa68744 (diff) | |
download | stable-diffusion-webui-gfx803-d4dc4c1c633e27e7cb1a7208e8c39376dbee2d97.tar.gz stable-diffusion-webui-gfx803-d4dc4c1c633e27e7cb1a7208e8c39376dbee2d97.tar.bz2 stable-diffusion-webui-gfx803-d4dc4c1c633e27e7cb1a7208e8c39376dbee2d97.zip |
fix for Error Interrogating when user has garbage in text files #479
-rw-r--r-- | modules/interrogate.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/interrogate.py b/modules/interrogate.py index 06862fcc..f62a4745 100644 --- a/modules/interrogate.py +++ b/modules/interrogate.py @@ -98,7 +98,7 @@ class InterrogateModels: text_array = text_array[0:int(shared.opts.interrogate_clip_dict_limit)]
top_count = min(top_count, len(text_array))
- text_tokens = clip.tokenize([text for text in text_array]).to(shared.device)
+ text_tokens = clip.tokenize([text for text in text_array], truncate=True).to(shared.device)
text_features = self.clip_model.encode_text(text_tokens).type(self.dtype)
text_features /= text_features.norm(dim=-1, keepdim=True)
|