diff --git a/mz_train_tools_core.py b/mz_train_tools_core.py index 4210343..18d2ceb 100644 --- a/mz_train_tools_core.py +++ b/mz_train_tools_core.py @@ -32,6 +32,9 @@ def MZ_KohyaSSInitWorkspace_call(args={}): # 查看本地分支是否一致 result = subprocess.run( ["git", "branch"], cwd=kohya_ss_lora_dir, stdout=subprocess.PIPE, check=True) + + print(f"current branch: {result.stdout}") + if branch.encode() not in result.stdout: subprocess.run( ["git", "remote", "set-branches", "origin", branch], cwd=kohya_ss_lora_dir, check=True) @@ -239,6 +242,8 @@ def check_install(): import accelerate except ImportError: os.system(f"{sys.executable} -m pip install accelerate") + + import logging diff --git a/mz_train_tools_utils.py b/mz_train_tools_utils.py index 678a144..ce938de 100644 --- a/mz_train_tools_utils.py +++ b/mz_train_tools_utils.py @@ -796,11 +796,12 @@ class Utils: common_prefix += c return common_prefix - + common_prefix = get_common_prefix(pre_render_texts_x) if common_prefix != "": - pre_render_texts_x = [x.replace(common_prefix, "") for x in pre_render_texts_x] + pre_render_texts_x = [ + x.replace(common_prefix, "") for x in pre_render_texts_x] x_enable_num = len(pre_render_images) y_enable_num = len(pre_render_images[0])