Global replace [ \t]+$, add "GB" (#1751)

* "GB"

* Replace [ \t]+$ global

Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>
This commit is contained in:
Scott Lahteine
2022-12-19 10:36:39 -06:00
committed by GitHub
parent 4fd97ceddd
commit 7d8d4bcafb
45 changed files with 575 additions and 148 deletions

View File

@ -24,7 +24,7 @@ for f in filenames:
except PermissionError:
sys.stderr.write(f'{f} could not be opened due to inadequate permissions\n')
continue

View File

@ -398,7 +398,7 @@ SAMPLER_CHOICES = [
def create_argv_parser():
parser = argparse.ArgumentParser(
description="""Generate images using Stable Diffusion.
Use --web to launch the web interface.
Use --web to launch the web interface.
Use --from_file to load prompts from a file path or standard input ("-").
Otherwise you will be dropped into an interactive command prompt (type -h for help.)
Other command-line arguments are defaults that can usually be overridden

View File

@ -8,9 +8,9 @@ from functools import partial
import torch
def get_placeholder_loop(placeholder_string, embedder, use_bert):
new_placeholder = None
while True:
if new_placeholder is None:
new_placeholder = input(f"Placeholder string {placeholder_string} was already used. Please enter a replacement string: ")
@ -21,7 +21,7 @@ def get_placeholder_loop(placeholder_string, embedder, use_bert):
if token is not None:
return new_placeholder, token
def get_clip_token_for_string(tokenizer, string):
batch_encoding = tokenizer(
string,
@ -37,7 +37,7 @@ def get_clip_token_for_string(tokenizer, string):
if torch.count_nonzero(tokens - 49407) == 2:
return tokens[0, 1]
return None
def get_bert_token_for_string(tokenizer, string):
@ -53,16 +53,16 @@ if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--root_dir",
type=str,
"--root_dir",
type=str,
default='.',
help="Path to the InvokeAI install directory containing 'models', 'outputs' and 'configs'."
)
parser.add_argument(
"--manager_ckpts",
type=str,
nargs="+",
"--manager_ckpts",
type=str,
nargs="+",
required=True,
help="Paths to a set of embedding managers to be merged."
)
@ -90,7 +90,7 @@ if __name__ == "__main__":
EmbeddingManager = partial(EmbeddingManager, embedder, ["*"])
string_to_token_dict = {}
string_to_token_dict = {}
string_to_param_dict = torch.nn.ParameterDict()
placeholder_to_src = {}