Browse Source

Cleanup async tasks to task returns

pull/165/head
Ionite 1 year ago
parent
commit
1ece86e2db
No known key found for this signature in database
  1. 12
      StabilityMatrix.Core/Models/Packages/BasePackage.cs

12
StabilityMatrix.Core/Models/Packages/BasePackage.cs

@ -181,7 +181,7 @@ public abstract class BasePackage
await venvRunner.PipInstall("xformers", onConsoleOutput).ConfigureAwait(false); await venvRunner.PipInstall("xformers", onConsoleOutput).ConfigureAwait(false);
} }
protected async Task InstallDirectMlTorch( protected Task InstallDirectMlTorch(
PyVenvRunner venvRunner, PyVenvRunner venvRunner,
IProgress<ProgressReport>? progress = null, IProgress<ProgressReport>? progress = null,
Action<ProcessOutput>? onConsoleOutput = null Action<ProcessOutput>? onConsoleOutput = null
@ -191,12 +191,10 @@ public abstract class BasePackage
new ProgressReport(-1f, "Installing PyTorch for DirectML", isIndeterminate: true) new ProgressReport(-1f, "Installing PyTorch for DirectML", isIndeterminate: true)
); );
await venvRunner return venvRunner.PipInstall(PyVenvRunner.TorchPipInstallArgsDirectML, onConsoleOutput);
.PipInstall(PyVenvRunner.TorchPipInstallArgsDirectML, onConsoleOutput)
.ConfigureAwait(false);
} }
protected async Task InstallCpuTorch( protected Task InstallCpuTorch(
PyVenvRunner venvRunner, PyVenvRunner venvRunner,
IProgress<ProgressReport>? progress = null, IProgress<ProgressReport>? progress = null,
Action<ProcessOutput>? onConsoleOutput = null Action<ProcessOutput>? onConsoleOutput = null
@ -206,8 +204,6 @@ public abstract class BasePackage
new ProgressReport(-1f, "Installing PyTorch for CPU", isIndeterminate: true) new ProgressReport(-1f, "Installing PyTorch for CPU", isIndeterminate: true)
); );
await venvRunner return venvRunner.PipInstall(PyVenvRunner.TorchPipInstallArgsCpu, onConsoleOutput);
.PipInstall(PyVenvRunner.TorchPipInstallArgsCpu, onConsoleOutput)
.ConfigureAwait(false);
} }
} }

Loading…
Cancel
Save