mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 21:46:30 +00:00
fix auth, decryption, api interaction
This commit is contained in:
+9
-11
@@ -35,7 +35,14 @@ cdef class CommandProcessor:
|
||||
self.running = True
|
||||
|
||||
def start(self):
|
||||
threading.Thread(target=self.process_queue, daemon=True).start()
|
||||
while self.running:
|
||||
try:
|
||||
command = self.command_queue.get()
|
||||
print(f'command is : {command}')
|
||||
model = self.api_client.load_ai_model()
|
||||
Inference(model, self.on_annotations).run_inference(command)
|
||||
except Exception as e:
|
||||
print(f"Error processing queue: {e}")
|
||||
|
||||
cdef on_message(self, FileCommand cmd):
|
||||
try:
|
||||
@@ -51,17 +58,8 @@ cdef class CommandProcessor:
|
||||
handler.send(annotations)
|
||||
|
||||
|
||||
cdef process_queue(self):
|
||||
while self.running:
|
||||
try:
|
||||
command = self.command_queue.get()
|
||||
model = self.api_client.load_ai_model()
|
||||
Inference(model, self.on_annotations).run_inference(command)
|
||||
except Exception as e:
|
||||
print(f"Error processing queue: {e}")
|
||||
|
||||
cdef process_load(self, FileCommand command):
|
||||
response = self.api_client.load_file(command)
|
||||
response = self.api_client.load_bytes(command.filename)
|
||||
handler = self.socket_handler if command.processor_type == ProcessorType.SOCKET else self.rabbit_handler
|
||||
handler.send(response)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user