From a625d5a49cb70a20c37ae31cc96f6c2cce2be86b Mon Sep 17 00:00:00 2001 From: Yuanchen Xu Date: Tue, 18 Jul 2023 17:02:19 +0800 Subject: [PATCH] [NFC] polish applications/Chat/inference/server.py code style --- applications/Chat/inference/server.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/applications/Chat/inference/server.py b/applications/Chat/inference/server.py index b4627299397e..e23f0fceb2fa 100644 --- a/applications/Chat/inference/server.py +++ b/applications/Chat/inference/server.py @@ -14,7 +14,7 @@ from slowapi.util import get_remote_address from sse_starlette.sse import EventSourceResponse from transformers import AutoTokenizer, GenerationConfig, LlamaForCausalLM -from utils import ChatPromptProcessor, Dialogue, LockedIterator, sample_streamingly, update_model_kwargs_fn, load_json +from utils import ChatPromptProcessor, Dialogue, LockedIterator, load_json, sample_streamingly, update_model_kwargs_fn CONTEXT = 'Below is an instruction that describes a task. Write a response that appropriately completes the request. Do not generate new instructions.' MAX_LEN = 512 @@ -145,7 +145,9 @@ def generate_no_stream(data: GenerationTaskReq, request: Request): help='Group size for GPTQ. This is only useful when quantization mode is 4bit. Default: 128.') parser.add_argument('--http_host', default='0.0.0.0') parser.add_argument('--http_port', type=int, default=7070) - parser.add_argument('--profanity_file', default=None, help='Path to profanity words list. It should be a JSON file containing a list of words.') + parser.add_argument('--profanity_file', + default=None, + help='Path to profanity words list. It should be a JSON file containing a list of words.') args = parser.parse_args() if args.quant == '4bit':