You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1019 B
31 lines
1019 B
using StabilityMatrix.Core.Processes; |
|
|
|
namespace StabilityMatrix.Core.Python; |
|
|
|
public record PipInstallArgs : ProcessArgsBuilder |
|
{ |
|
public PipInstallArgs(params Argument[] arguments) |
|
: base(arguments) { } |
|
|
|
public PipInstallArgs WithTorch(string version = "") => this.AddArg($"torch{version}"); |
|
|
|
public PipInstallArgs WithTorchDirectML(string version = "") => |
|
this.AddArg($"torch-directml{version}"); |
|
|
|
public PipInstallArgs WithTorchVision(string version = "") => |
|
this.AddArg($"torchvision{version}"); |
|
|
|
public PipInstallArgs WithXFormers(string version = "") => this.AddArg($"xformers{version}"); |
|
|
|
public PipInstallArgs WithExtraIndex(string indexUrl) => |
|
this.AddArg(("--extra-index-url", indexUrl)); |
|
|
|
public PipInstallArgs WithTorchExtraIndex(string index) => |
|
this.AddArg(("--extra-index-url", $"https://download.pytorch.org/whl/{index}")); |
|
|
|
/// <inheritdoc /> |
|
public override string ToString() |
|
{ |
|
return base.ToString(); |
|
} |
|
}
|
|
|