Skip to content

Commit

Permalink
BUG: cmdline chat duplicates user msg (#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
UranusSeven authored Sep 6, 2023
1 parent 10f839e commit d0504d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xinference/deploy/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,6 @@ async def chat_internal():
prompt = input("User: ")
if prompt == "":
break
chat_history.append(ChatCompletionMessage(role="user", content=prompt))
print("Assistant: ", end="", file=sys.stdout)
response_content = ""
async for chunk in model.chat(
Expand All @@ -612,6 +611,7 @@ async def chat_internal():
response_content += delta["content"]
print(delta["content"], end="", flush=True, file=sys.stdout)
print("\n", file=sys.stdout)
chat_history.append(ChatCompletionMessage(role="user", content=prompt))
chat_history.append(
ChatCompletionMessage(role="assistant", content=response_content)
)
Expand Down

0 comments on commit d0504d8

Please sign in to comment.