move python inference to Azaion.Inference folder

This commit is contained in:
Alex Bezdieniezhnykh
2025-02-06 10:48:03 +02:00
parent 739759628a
commit ba3e3b4a55
39 changed files with 313 additions and 173 deletions
@@ -46,21 +46,19 @@ public class PythonResourceLoader : IResourceLoader, IAuthProvider
private void StartPython( ApiConfig apiConfig, ApiCredentials credentials)
{
//var inferenceExe = LoadPythonFile().GetAwaiter().GetResult();
string outputProcess = "";
string errorProcess = "";
var path = "azaion-inference.exe";
var arguments = $"-e {credentials.Email} -p {credentials.Password} -f {apiConfig.ResourcesFolder}";
using var process = new Process();
process.StartInfo.FileName = path;
process.StartInfo.Arguments = arguments;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
//process.StartInfo.CreateNoWindow = true;
process.OutputDataReceived += (sender, e) => { if (e.Data != null) Console.WriteLine(e.Data); };
process.ErrorDataReceived += (sender, e) => { if (e.Data != null) Console.WriteLine(e.Data); };
process.StartInfo = new ProcessStartInfo
{
FileName = SecurityConstants.AzaionInferencePath,
Arguments = $"-e {credentials.Email} -p {credentials.Password} -f {apiConfig.ResourcesFolder}",
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true,
//CreateNoWindow = true
};
process.OutputDataReceived += (_, e) => { if (e.Data != null) Console.WriteLine(e.Data); };
process.ErrorDataReceived += (_, e) => { if (e.Data != null) Console.WriteLine(e.Data); };
process.Start();
}