From cb72bfa11972646ce3d437fd1656a54a7d7d52ef Mon Sep 17 00:00:00 2001 From: UranusSeven <109661872+UranusSeven@users.noreply.github.com> Date: Thu, 7 Sep 2023 21:19:51 +0800 Subject: [PATCH] BUG: cmdline double line breaker --- xinference/deploy/cmdline.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xinference/deploy/cmdline.py b/xinference/deploy/cmdline.py index a5021e06e8..315c567be1 100644 --- a/xinference/deploy/cmdline.py +++ b/xinference/deploy/cmdline.py @@ -481,9 +481,9 @@ def model_terminate( ) @click.option( "--max_tokens", - default=256, + default=512, type=int, - help="Maximum number of tokens in the generated text (default is 256).", + help="Maximum number of tokens in the generated text (default is 512).", ) @click.option( "--stream", @@ -519,7 +519,7 @@ async def generate_internal(): continue else: print(choice["text"], end="", flush=True, file=sys.stdout) - print("\n", file=sys.stdout) + print("", file=sys.stdout) client = Client(endpoint=endpoint) model = client.get_model(model_uid=model_uid) @@ -567,9 +567,9 @@ async def generate_internal(): @click.option("--model-uid", type=str, help="The unique identifier (UID) of the model.") @click.option( "--max_tokens", - default=256, + default=512, type=int, - help="Maximum number of tokens in each message (default is 256).", + help="Maximum number of tokens in each message (default is 512).", ) @click.option( "--stream", @@ -610,7 +610,7 @@ async def chat_internal(): else: response_content += delta["content"] print(delta["content"], end="", flush=True, file=sys.stdout) - print("\n", file=sys.stdout) + print("", file=sys.stdout) chat_history.append(ChatCompletionMessage(role="user", content=prompt)) chat_history.append( ChatCompletionMessage(role="assistant", content=response_content)