feat: arena models

This commit is contained in:
Timothy J. Baek
2024-10-22 03:16:48 -07:00
parent ee16177924
commit 9f285fb2fb
29 changed files with 974 additions and 43 deletions

View File

@@ -116,6 +116,9 @@ def convert_messages_openai_to_ollama(messages: list[dict]) -> list[dict]:
elif item.get("type") == "image_url":
img_url = item.get("image_url", {}).get("url", "")
if img_url:
# If the image url starts with data:, it's a base64 image and should be trimmed
if img_url.startswith("data:"):
img_url = img_url.split(",")[-1]
images.append(img_url)
# Add content text (if any)