Skip to content

Commit

Permalink
fix wildcard scripts to work on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
bzlibby authored and ssube committed Jul 13, 2023
1 parent ae6166a commit 5ecc874
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/onnx_web/diffusers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
CLIP_TOKEN = compile(r"\<clip:([-\w]+):(\d+)\>")
INVERSION_TOKEN = compile(r"\<inversion:([^:\>]+):(-?[\.|\d]+)\>")
LORA_TOKEN = compile(r"\<lora:([^:\>]+):(-?[\.|\d]+)\>")
WILDCARD_TOKEN = compile(r"__([-/\w]+)__")
WILDCARD_TOKEN = compile(r"__([-/\\\w]+)__")

INTERVAL_RANGE = compile(r"(\w+)-{(\d+),(\d+)(?:,(\d+))?}")
ALTERNATIVE_RANGE = compile(r"\(([^\)]+)\)")
Expand Down
2 changes: 1 addition & 1 deletion api/onnx_web/server/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ def load_wildcards(server: ServerContext) -> None:
)

for file in wildcard_files:
with open(path.join(server.model_path, "wildcard", f"{file}.txt"), "r") as f:
with open(path.join(server.model_path, "wildcard", file), "r", encoding="utf-8") as f:
lines = f.read().splitlines()
lines = [line.strip() for line in lines if not line.startswith("#")]
lines = [line for line in lines if len(line) > 0]
Expand Down

0 comments on commit 5ecc874

Please sign in to comment.