mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 10:46:30 +00:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
zmq_port: 5131
|
||||
api_url: https://api.azaion.com
|
||||
@@ -1,2 +0,0 @@
|
||||
zmq_port: 5127
|
||||
api_url: http://localhost:5219
|
||||
@@ -13,7 +13,6 @@ from remote_command cimport RemoteCommand, CommandType
|
||||
from remote_command_handler cimport RemoteCommandHandler
|
||||
from credentials cimport Credentials
|
||||
from file_data cimport FileData
|
||||
from user cimport User
|
||||
|
||||
cdef class CommandProcessor:
|
||||
cdef ApiClient api_client
|
||||
@@ -22,12 +21,7 @@ cdef class CommandProcessor:
|
||||
cdef bint running
|
||||
cdef Inference inference
|
||||
|
||||
def __init__(self):
|
||||
with open(<str>constants.CONFIG_FILE, "r") as f:
|
||||
config = yaml.safe_load(f)
|
||||
zmq_port = config["zmq_port"]
|
||||
api_url = config["api_url"]
|
||||
|
||||
def __init__(self, int zmq_port, str api_url):
|
||||
self.api_client = ApiClient(api_url)
|
||||
self.remote_handler = RemoteCommandHandler(zmq_port, self.on_command)
|
||||
self.inference_queue = Queue(maxsize=constants.QUEUE_MAXSIZE)
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
from main import CommandProcessor
|
||||
import argparse
|
||||
|
||||
|
||||
def start():
|
||||
processor = CommandProcessor()
|
||||
def start(zmq_port, api_url):
|
||||
processor = CommandProcessor(zmq_port, api_url)
|
||||
try:
|
||||
processor.start()
|
||||
except KeyboardInterrupt:
|
||||
@@ -10,4 +11,9 @@ def start():
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
start()
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("-p", "--port", type=str, default="5127", help="zero mq port")
|
||||
parser.add_argument("-a", "--api", type=str, default="https://api.azaion.com", help="api url")
|
||||
args = parser.parse_args()
|
||||
|
||||
start(int(args.port), args.api)
|
||||
|
||||
Reference in New Issue
Block a user