Browse Source

Merge pull request #567 from ionite34/headless-kohya

Update for headless kohya cli arg
pull/629/head
JT 8 months ago committed by GitHub
parent
commit
72f4cf04a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 23
      StabilityMatrix.Core/Models/Packages/KohyaSs.cs

23
StabilityMatrix.Core/Models/Packages/KohyaSs.cs

@ -132,32 +132,19 @@ public class KohyaSs(
await venvRunner.Setup(true, onConsoleOutput).ConfigureAwait(false); await venvRunner.Setup(true, onConsoleOutput).ConfigureAwait(false);
// Extra dep needed before running setup since v23.0.x // Extra dep needed before running setup since v23.0.x
await venvRunner.PipInstall("packaging").ConfigureAwait(false); await venvRunner.PipInstall(["rich", "packaging"]).ConfigureAwait(false);
if (Compat.IsWindows) if (Compat.IsWindows)
{ {
var setupSmPath = Path.Combine(installLocation, "setup", "setup_sm.py");
var setupText = """
import setup_windows
import setup_common
setup_common.install_requirements('requirements_windows_torch2.txt', check_no_verify_flag=False)
setup_windows.sync_bits_and_bytes_files()
setup_common.configure_accelerate(run_accelerate=False)
""";
await File.WriteAllTextAsync(setupSmPath, setupText).ConfigureAwait(false);
// Install // Install
await venvRunner.CustomInstall("setup/setup_sm.py", onConsoleOutput).ConfigureAwait(false); await venvRunner
await venvRunner.PipInstall("bitsandbytes-windows").ConfigureAwait(false); .CustomInstall("setup/setup_windows.py --headless", onConsoleOutput)
.ConfigureAwait(false);
} }
else if (Compat.IsLinux) else if (Compat.IsLinux)
{ {
await venvRunner await venvRunner
.CustomInstall( .CustomInstall("setup/setup_linux.py --headless", onConsoleOutput)
"setup/setup_linux.py --platform-requirements-file=requirements_linux.txt --no_run_accelerate",
onConsoleOutput
)
.ConfigureAwait(false); .ConfigureAwait(false);
} }
} }

Loading…
Cancel
Save