@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 9d59b75593
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 16, 08:15 UTC

[Bugfix] Remove CustomChatCompletionContentPartParam multimodal input type (#10054)

Signed-off-by: Zifei Tong <zifeitong@gmail.com>

zifeitong committed Nov 5, 2024 at 21:13 UTC 9d59b755934899b7ec5d7bb5b90d15bfd2302475
1 file changed +2 -11
vllm/entrypoints/chat_utils.py
+2 -11
@@ -22,7 +22,6 @@ from openai.types.chat import (ChatCompletionMessageToolCallParam,
22 ChatCompletionToolMessageParam)
23 # yapf: enable
24 # pydantic needs the TypedDict from typing_extensions
25 -from pydantic import ConfigDict
25 from transformers import PreTrainedTokenizer, PreTrainedTokenizerFast
26 from typing_extensions import Required, TypeAlias, TypedDict
27
@@ -52,17 +51,10 @@ class ChatCompletionContentPartAudioParam(TypedDict, total=False):
51 """The type of the content part."""
52
53
55 -class CustomChatCompletionContentPartParam(TypedDict, total=False):
56 - __pydantic_config__ = ConfigDict(extra="allow") # type: ignore
57 -
58 - type: Required[str]
59 - """The type of the content part."""
60 -
61 -
54 class CustomChatCompletionContentSimpleImageParam(TypedDict, total=False):
55 """A simpler version of the param that only accepts a plain image_url.
56 This is supported by OpenAI API, although it is not documented.
65 -
57 +
58 Example:
59 {
60 "image_url": "https://example.com/image.jpg"
@@ -73,7 +65,7 @@ class CustomChatCompletionContentSimpleImageParam(TypedDict, total=False):
65
66 class CustomChatCompletionContentSimpleAudioParam(TypedDict, total=False):
67 """A simpler version of the param that only accepts a plain audio_url.
76 -
68 +
69 Example:
70 {
71 "audio_url": "https://example.com/audio.mp3"
@@ -85,7 +77,6 @@ class CustomChatCompletionContentSimpleAudioParam(TypedDict, total=False):
77 ChatCompletionContentPartParam: TypeAlias = Union[
78 OpenAIChatCompletionContentPartParam, ChatCompletionContentPartAudioParam,
79 ChatCompletionContentPartRefusalParam,
88 - CustomChatCompletionContentPartParam,
80 CustomChatCompletionContentSimpleImageParam,
81 CustomChatCompletionContentSimpleAudioParam, str]
82