From 60bb4df617c136dc2967f3d0113a98793e9ddda4 Mon Sep 17 00:00:00 2001 From: akiba Date: Thu, 31 Aug 2023 10:35:24 +0800 Subject: [PATCH] major: rename toml folder to config --- .gitignore | 1 + {toml => config}/default.toml | 0 {toml => config}/lora.toml | 0 {toml => config}/sample_prompts.txt | 0 gui.py | 2 +- mikazuki/app.py | 4 ++-- train_by_toml.ps1 | 4 ++-- train_by_toml.sh | 4 ++-- 8 files changed, 8 insertions(+), 7 deletions(-) rename {toml => config}/default.toml (100%) rename {toml => config}/lora.toml (100%) rename {toml => config}/sample_prompts.txt (100%) diff --git a/.gitignore b/.gitignore index 5d444f9..d64edd6 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ train/* logs/* sd-models/* toml/autosave/* +config/autosave/* !sd-models/put stable diffusion model here.txt !logs/.keep diff --git a/toml/default.toml b/config/default.toml similarity index 100% rename from toml/default.toml rename to config/default.toml diff --git a/toml/lora.toml b/config/lora.toml similarity index 100% rename from toml/lora.toml rename to config/lora.toml diff --git a/toml/sample_prompts.txt b/config/sample_prompts.txt similarity index 100% rename from toml/sample_prompts.txt rename to config/sample_prompts.txt diff --git a/gui.py b/gui.py index 4238d97..c277682 100644 --- a/gui.py +++ b/gui.py @@ -32,7 +32,7 @@ if __name__ == "__main__": setup_logging() smart_pip_mirror() prepare_frontend() - check_dirs(["toml/autosave", "logs"]) + check_dirs(["config/autosave", "logs"]) if not args.skip_prepare_environment: requirements_file = "requirements_win.txt" if sys.platform == "win32" else "requirements.txt" validate_requirements(requirements_file) diff --git a/mikazuki/app.py b/mikazuki/app.py index 8808044..26efe61 100644 --- a/mikazuki/app.py +++ b/mikazuki/app.py @@ -85,7 +85,7 @@ async def create_toml_file(request: Request, background_tasks: BackgroundTasks): return {"status": "fail", "detail": "已有正在进行的训练"} timestamp = datetime.now().strftime("%Y%m%d-%H%M%S") - toml_file = os.path.join(os.getcwd(), f"toml", "autosave", f"{timestamp}.toml") + toml_file = os.path.join(os.getcwd(), f"config", "autosave", f"{timestamp}.toml") toml_data = await request.body() j = json.loads(toml_data.decode("utf-8")) @@ -111,7 +111,7 @@ async def create_toml_file(request: Request, background_tasks: BackgroundTasks): sample_prompts = j.get("sample_prompts", None) if sample_prompts is not None and not os.path.exists(sample_prompts) and is_promopt_like(sample_prompts): - sample_prompts_file = os.path.join(os.getcwd(), f"toml", "autosave", f"{timestamp}-promopt.txt") + sample_prompts_file = os.path.join(os.getcwd(), f"config", "autosave", f"{timestamp}-promopt.txt") with open(sample_prompts_file, "w", encoding="utf-8") as f: f.write(sample_prompts) j["sample_prompts"] = sample_prompts_file diff --git a/train_by_toml.ps1 b/train_by_toml.ps1 index 60a37dc..0bbc57d 100644 --- a/train_by_toml.ps1 +++ b/train_by_toml.ps1 @@ -1,8 +1,8 @@ # LoRA train script by @Akegarasu $multi_gpu = 0 # multi gpu | Կѵ òԿ >= 2 ʹ -$config_file = "./toml/default.toml" # config_file | ʹtomlļָѵ -$sample_prompts = "./toml/sample_prompts.txt" # sample_prompts | promptsļ,ò +$config_file = "./config/default.toml" # config_file | ʹtomlļָѵ +$sample_prompts = "./config/sample_prompts.txt" # sample_prompts | promptsļ,ò $utf8 = 1 # utf8 | ʹutf-8ȡtomlutf-8дġĵtoml뿪 diff --git a/train_by_toml.sh b/train_by_toml.sh index f4e44f0..4ebd5aa 100644 --- a/train_by_toml.sh +++ b/train_by_toml.sh @@ -2,8 +2,8 @@ # LoRA train script by @Akegarasu multi_gpu=0 # multi gpu | 多显卡训练 该参数仅限在显卡数 >= 2 使用 -config_file="./toml/default.toml" # config_file | 使用toml文件指定训练参数 -sample_prompts="./toml/sample_prompts.txt" # sample_prompts | 采样prompts文件,留空则不启用采样功能 +config_file="./config/default.toml" # config_file | 使用toml文件指定训练参数 +sample_prompts="./config/sample_prompts.txt" # sample_prompts | 采样prompts文件,留空则不启用采样功能 utf8=1 # utf8 | 使用utf-8编码读取toml;以utf-8编码编写的、含中文的toml必须开启 # ============= DO NOT MODIFY CONTENTS BELOW | 请勿修改下方内容 =====================