mirror of
https://github.com/azaion/annotations.git
synced 2026-04-23 00:16:30 +00:00
move python inference to Azaion.Inference folder
This commit is contained in:
@@ -23,4 +23,6 @@ public class SecurityConstants
|
||||
public const int ZMQ_PORT = 5127;
|
||||
|
||||
#endregion SocketClient
|
||||
|
||||
public static string AzaionInferencePath = "azaion-inference.exe";
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user