Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: cmdline double line breaker #441

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions xinference/deploy/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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)
Expand Down