Skip to content

Commit

Permalink
change delimiter to |
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Mar 31, 2021
1 parent 9ba158b commit 09671d2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ dream = Imagine(
dream()
```

> You can now train more than one phrase using the delimiter "\\"
> You can now train more than one phrase using the delimiter "|"
### Train on Multiple Phrases
In this example we train on three phrases:
Expand All @@ -104,7 +104,7 @@ In this example we train on three phrases:
from big_sleep import Imagine

dream = Imagine(
text = "an armchair in the form of pikachu\\an armchair imitating pikachu\\abstract",
text = "an armchair in the form of pikachu|an armchair imitating pikachu|abstract",
lr = 5e-2,
save_every = 25,
save_progress = True
Expand All @@ -124,8 +124,8 @@ In this example we train on the three phrases from before,
from big_sleep import Imagine

dream = Imagine(
text = "an armchair in the form of pikachu\\an armchair imitating pikachu\\abstract",
text_min = "blur\\zoom",
text = "an armchair in the form of pikachu|an armchair imitating pikachu|abstract",
text_min = "blur|zoom",
)
dream()
```
Expand Down
4 changes: 2 additions & 2 deletions big_sleep/big_sleep.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,8 @@ def create_img_encoding(self, img):


def encode_multiple_phrases(self, text, img=None, encoding=None, text_type="max"):
if text is not None and "\\" in text:
self.encoded_texts[text_type] = [self.create_clip_encoding(text=prompt_min, img=img, encoding=encoding) for prompt_min in text.split("\\")]
if text is not None and "|" in text:
self.encoded_texts[text_type] = [self.create_clip_encoding(text=prompt_min, img=img, encoding=encoding) for prompt_min in text.split("|")]
else:
self.encoded_texts[text_type] = [self.create_clip_encoding(text=text, img=img, encoding=encoding)]

Expand Down
2 changes: 1 addition & 1 deletion big_sleep/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.8.1'
__version__ = '0.8.2'

0 comments on commit 09671d2

Please sign in to comment.