refactor external clients

put model batch size as parameter in config
This commit is contained in:
Alex Bezdieniezhnykh
2025-03-24 00:33:41 +02:00
parent 32f9de3c71
commit 6429ad62c2
28 changed files with 352 additions and 226 deletions
@@ -11,10 +11,10 @@ public class RemoteCommand(CommandType commandType, byte[]? data = null)
[Key("Data")]
public byte[]? Data { get; set; } = data;
public static byte[] Serialize<T>(CommandType commandType, T data) where T : class
public static RemoteCommand Create<T>(CommandType commandType, T data) where T : class
{
var dataBytes = MessagePackSerializer.Serialize(data);
return MessagePackSerializer.Serialize(new RemoteCommand(commandType, dataBytes ));
return new RemoteCommand(commandType, dataBytes);
}
}
@@ -1,11 +1,16 @@
namespace Azaion.CommonSecurity.DTO;
public class PythonConfig
public abstract class ExternalClientConfig
{
public string ZeroMqHost { get; set; } = "";
public int ZeroMqPort { get; set; }
public double OneTryTimeoutSeconds { get; set; }
public int RetryCount {get;set;}
}
public class InferenceClientConfig : ExternalClientConfig
{
public string ResourcesFolder { get; set; } = "";
}
public class GpsDeniedClientConfig : ExternalClientConfig;
+2 -1
View File
@@ -2,5 +2,6 @@
public class SecureAppConfig
{
public PythonConfig PythonConfig { get; set; } = null!;
public InferenceClientConfig InferenceClientConfig { get; set; } = null!;
public GpsDeniedClientConfig GpsDeniedClientConfig { get; set; } = null!;
}