OAI: Fix chat completion list parsing

The strings weren't being concatenated properly. Only add the combined
text if the chat completion type is a List.

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri 2024-11-22 17:30:29 -05:00
parent eadc71a4c3
commit 388d36e6bd

View file

@ -220,11 +220,12 @@ async def format_messages_with_template(
await mm_embeddings.add(content.image_url.url)
concatenated_content += mm_embeddings.text_alias[-1]
# Convert the message content into a concatenated string
message.content = concatenated_content
if message.tool_calls:
message.tool_calls_json = json.dumps(message.tool_calls, indent=2)
message.content = concatenated_content
special_tokens_dict = model.container.get_special_tokens(
add_bos_token, ban_eos_token
)