diff --git a/python/paddle_serving_server_gpu/web_service.py b/python/paddle_serving_server_gpu/web_service.py index fbb52470d48f45795c6e910600a1368d4bf3d8d2..8c3ae58df5103b196a2d85d2a794e7e56d460175 100755 --- a/python/paddle_serving_server_gpu/web_service.py +++ b/python/paddle_serving_server_gpu/web_service.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. +g # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -24,6 +24,10 @@ import time import random +def producers(input_queue, output_queue, endpoint): + pass + + class WebService(object): def __init__(self, name="default_service"): self.name = name @@ -100,6 +104,18 @@ class WebService(object): time.sleep(1) service_name = "/" + self.name + "/prediction" + input_queues = [] + output_queue = Queue() + for i in range(gpu_num): + input_queues.append(Queue()) + + @app_instance.route("{}_batch".format(service_name), methods['POST']) + def get_prediction(): + if not request.json: + abort(400) + if "fetch" not in request.json: + abort(400) + @app_instance.route(service_name, methods=['POST']) def get_prediction(): if not request.json: