Spaces:
Runtime error
Runtime error
once again is not -> != ; weird python versioning error causing this?
Browse files
model.py
CHANGED
@@ -87,7 +87,7 @@ class VirTexModel:
|
|
87 |
)
|
88 |
subreddit_tokens = torch.tensor(subreddit_tokens, device=self.device).long()
|
89 |
|
90 |
-
if prompt
|
91 |
# at present prompts without subreddits will break without this change
|
92 |
# TODO FIX
|
93 |
cap_tokens = self.tokenizer.encode(prompt)
|
@@ -129,7 +129,7 @@ class VirTexModel:
|
|
129 |
subreddit, rest_of_caption = "", caption.strip()
|
130 |
|
131 |
# split prompt for coloring:
|
132 |
-
if prompt
|
133 |
_, rest_of_caption = caption.split(prompt.strip())
|
134 |
|
135 |
is_valid_subreddit = subreddit in self.valid_subs
|
|
|
87 |
)
|
88 |
subreddit_tokens = torch.tensor(subreddit_tokens, device=self.device).long()
|
89 |
|
90 |
+
if prompt != "":
|
91 |
# at present prompts without subreddits will break without this change
|
92 |
# TODO FIX
|
93 |
cap_tokens = self.tokenizer.encode(prompt)
|
|
|
129 |
subreddit, rest_of_caption = "", caption.strip()
|
130 |
|
131 |
# split prompt for coloring:
|
132 |
+
if prompt != "":
|
133 |
_, rest_of_caption = caption.split(prompt.strip())
|
134 |
|
135 |
is_valid_subreddit = subreddit in self.valid_subs
|