From 09671d2af212b08f3bf894add5d31db5af1dc28c Mon Sep 17 00:00:00 2001 From: Phil Wang Date: Wed, 31 Mar 2021 10:58:36 -0700 Subject: [PATCH] change delimiter to | --- README.md | 8 ++++---- big_sleep/big_sleep.py | 4 ++-- big_sleep/version.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 854c658..bace5d3 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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 @@ -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() ``` diff --git a/big_sleep/big_sleep.py b/big_sleep/big_sleep.py index 9ff10b3..99d3f50 100644 --- a/big_sleep/big_sleep.py +++ b/big_sleep/big_sleep.py @@ -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)] diff --git a/big_sleep/version.py b/big_sleep/version.py index ef72cc0..4ca39e7 100644 --- a/big_sleep/version.py +++ b/big_sleep/version.py @@ -1 +1 @@ -__version__ = '0.8.1' +__version__ = '0.8.2'