Sfoglia il codice sorgente

Fix OpenAI chat completions compatibility (#559)

ummmm u cant index a python dict w/ dot notation, sillyhead
Drake 7 mesi fa
parent
commit
e1a142c179
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      aphrodite/endpoints/openai/serving_chat.py

+ 1 - 1
aphrodite/endpoints/openai/serving_chat.py

@@ -58,7 +58,7 @@ class OpenAIServingChat(OpenAIServing):
         # Deal with list in messages.content
         # Deal with list in messages.content
         # Just replace the content list with the very first text message
         # Just replace the content list with the very first text message
         for message in request.messages:
         for message in request.messages:
-            if message.role == "user" and isinstance(message["content"], list):
+            if message["role"] == "user" and isinstance(message["content"], list):
                 message["content"] = next((content["text"]
                 message["content"] = next((content["text"]
                                            for content in message["content"]
                                            for content in message["content"]
                                            if content["type"] == "text"), "")
                                            if content["type"] == "text"), "")