mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-16 16:37:48 +01:00
--no_python CLI arg to disable python check and implems
This commit is contained in:
@@ -6,6 +6,8 @@ namespace Flowframes.Data
|
|||||||
{
|
{
|
||||||
class Implementations
|
class Implementations
|
||||||
{
|
{
|
||||||
|
public static bool DisablePython = false;
|
||||||
|
|
||||||
public static AI rifeCuda = new AI()
|
public static AI rifeCuda = new AI()
|
||||||
{
|
{
|
||||||
Backend = AI.AiBackend.Pytorch,
|
Backend = AI.AiBackend.Pytorch,
|
||||||
@@ -70,7 +72,6 @@ namespace Flowframes.Data
|
|||||||
SupportedFactors = new int[] { 2 },
|
SupportedFactors = new int[] { 2 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
public static List<AI> NetworksAll
|
public static List<AI> NetworksAll
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -83,7 +84,7 @@ namespace Flowframes.Data
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
bool pytorchAvailable = Python.IsPytorchReady();
|
bool pytorchAvailable = !DisablePython && Python.IsPytorchReady();
|
||||||
|
|
||||||
if (pytorchAvailable)
|
if (pytorchAvailable)
|
||||||
return NetworksAll;
|
return NetworksAll;
|
||||||
|
|||||||
@@ -124,6 +124,9 @@
|
|||||||
<Reference Include="Microsoft.WindowsAPICodePack.Shell, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.WindowsAPICodePack.Shell, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\WindowsAPICodePack-Shell.1.1.1\lib\Microsoft.WindowsAPICodePack.Shell.dll</HintPath>
|
<HintPath>packages\WindowsAPICodePack-Shell.1.1.1\lib\Microsoft.WindowsAPICodePack.Shell.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="NDesk.Options, Version=0.2.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>packages\NDesk.Options.0.2.1\lib\NDesk.Options.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
<HintPath>packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Flowframes.IO;
|
using Flowframes.Data;
|
||||||
|
using Flowframes.IO;
|
||||||
using Flowframes.MiscUtils;
|
using Flowframes.MiscUtils;
|
||||||
using Flowframes.Ui;
|
using Flowframes.Ui;
|
||||||
using System;
|
using System;
|
||||||
@@ -129,6 +130,9 @@ namespace Flowframes.Os
|
|||||||
|
|
||||||
static string GetPytorchVer()
|
static string GetPytorchVer()
|
||||||
{
|
{
|
||||||
|
if(Implementations.DisablePython)
|
||||||
|
return "";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Process py = OsUtils.NewProcess(true);
|
Process py = OsUtils.NewProcess(true);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using Flowframes.IO;
|
|||||||
using Flowframes.MiscUtils;
|
using Flowframes.MiscUtils;
|
||||||
using Flowframes.Os;
|
using Flowframes.Os;
|
||||||
using Flowframes.Ui;
|
using Flowframes.Ui;
|
||||||
|
using NDesk.Options;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
@@ -49,6 +50,20 @@ namespace Flowframes
|
|||||||
ServicePointManager.Expect100Continue = true;
|
ServicePointManager.Expect100Continue = true;
|
||||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
|
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
|
||||||
|
|
||||||
|
var opts = new OptionSet
|
||||||
|
{
|
||||||
|
{ "np|no_python", "Disable Python implementations", v => Implementations.DisablePython = v != null },
|
||||||
|
};
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
opts.Parse(Environment.GetCommandLineArgs());
|
||||||
|
}
|
||||||
|
catch (OptionException e)
|
||||||
|
{
|
||||||
|
Logger.Log($"Error parsing CLI option: {e.Message}", true);
|
||||||
|
}
|
||||||
|
|
||||||
Task.Run(() => DiskSpaceCheckLoop());
|
Task.Run(() => DiskSpaceCheckLoop());
|
||||||
fileArgs = Environment.GetCommandLineArgs().Where(a => a[0] != '-' && File.Exists(a)).ToList().Skip(1).ToArray();
|
fileArgs = Environment.GetCommandLineArgs().Where(a => a[0] != '-' && File.Exists(a)).ToList().Skip(1).ToArray();
|
||||||
args = Environment.GetCommandLineArgs().Where(a => a[0] == '-').Select(x => x.Trim().Substring(1).ToLowerInvariant()).ToArray();
|
args = Environment.GetCommandLineArgs().Where(a => a[0] == '-').Select(x => x.Trim().Substring(1).ToLowerInvariant()).ToArray();
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
<package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="net472" />
|
<package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="net472" />
|
||||||
<package id="Microsoft-WindowsAPICodePack-Core" version="1.1.4" targetFramework="net472" />
|
<package id="Microsoft-WindowsAPICodePack-Core" version="1.1.4" targetFramework="net472" />
|
||||||
<package id="Microsoft-WindowsAPICodePack-Shell" version="1.1.4" targetFramework="net472" />
|
<package id="Microsoft-WindowsAPICodePack-Shell" version="1.1.4" targetFramework="net472" />
|
||||||
|
<package id="NDesk.Options" version="0.2.1" targetFramework="net472" />
|
||||||
<package id="NETStandard.Library" version="1.6.1" targetFramework="net472" />
|
<package id="NETStandard.Library" version="1.6.1" targetFramework="net472" />
|
||||||
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net472" />
|
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net472" />
|
||||||
<package id="NvAPIWrapper.Net" version="0.8.1.101" targetFramework="net472" />
|
<package id="NvAPIWrapper.Net" version="0.8.1.101" targetFramework="net472" />
|
||||||
|
|||||||
Reference in New Issue
Block a user