mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 20:34:54 +00:00
Fixing signals.
Taking the signal handles later, so during loads, regular signal handling is done, we only need to handle SIGINT and SIGTERM during real loads to get more graceful shutdowns when queries are in flight.
This commit is contained in:
parent
b3dd3902e7
commit
68ec6cfa37
@ -35,9 +35,6 @@ class SignalHandler:
|
|||||||
self.KEEP_PROCESSING = False
|
self.KEEP_PROCESSING = False
|
||||||
|
|
||||||
|
|
||||||
signal_handler = SignalHandler()
|
|
||||||
|
|
||||||
|
|
||||||
class TextGenerationService(generate_pb2_grpc.TextGenerationServiceServicer):
|
class TextGenerationService(generate_pb2_grpc.TextGenerationServiceServicer):
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
@ -251,7 +248,7 @@ def serve(
|
|||||||
await server.start()
|
await server.start()
|
||||||
|
|
||||||
logger.info("Server started at {}".format(local_url))
|
logger.info("Server started at {}".format(local_url))
|
||||||
|
signal_handler = SignalHandler()
|
||||||
while signal_handler.KEEP_PROCESSING:
|
while signal_handler.KEEP_PROCESSING:
|
||||||
await asyncio.sleep(0.5)
|
await asyncio.sleep(0.5)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user