mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-25 17:29:22 +01:00
Fix the impersonate response role
This commit is contained in:
parent
34b493b231
commit
38b3daad55
@ -371,6 +371,7 @@ def chat_completions_common(body: dict, is_legacy: bool = False, stream=False, p
|
||||
|
||||
yield chunk
|
||||
else:
|
||||
role = 'user' if impersonate else 'assistant'
|
||||
resp = {
|
||||
"id": cmpl_id,
|
||||
"object": object_type,
|
||||
@ -379,7 +380,7 @@ def chat_completions_common(body: dict, is_legacy: bool = False, stream=False, p
|
||||
resp_list: [{
|
||||
"index": 0,
|
||||
"finish_reason": stop_reason,
|
||||
"message": {"role": "assistant", "content": answer}
|
||||
"message": {"role": role, "content": answer}
|
||||
}],
|
||||
"usage": {
|
||||
"prompt_tokens": token_count,
|
||||
|
Loading…
Reference in New Issue
Block a user