Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
ce26b162
Unverified
Commit
ce26b162
authored
Feb 07, 2025
by
Cyrus Leung
Committed by
GitHub
Feb 07, 2025
Browse files
[Misc] Remove unnecessary detokenization in multimodal processing (#12868)
parent
1918aa1b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
10 deletions
+7
-10
tests/entrypoints/openai/test_audio.py
tests/entrypoints/openai/test_audio.py
+3
-3
tests/entrypoints/openai/test_vision.py
tests/entrypoints/openai/test_vision.py
+2
-2
tests/entrypoints/openai/test_vision_embedding.py
tests/entrypoints/openai/test_vision_embedding.py
+2
-2
vllm/inputs/preprocess.py
vllm/inputs/preprocess.py
+0
-3
No files found.
tests/entrypoints/openai/test_audio.py
View file @
ce26b162
...
@@ -83,7 +83,7 @@ async def test_single_chat_session_audio(client: openai.AsyncOpenAI,
...
@@ -83,7 +83,7 @@ async def test_single_chat_session_audio(client: openai.AsyncOpenAI,
choice
=
chat_completion
.
choices
[
0
]
choice
=
chat_completion
.
choices
[
0
]
assert
choice
.
finish_reason
==
"length"
assert
choice
.
finish_reason
==
"length"
assert
chat_completion
.
usage
==
openai
.
types
.
CompletionUsage
(
assert
chat_completion
.
usage
==
openai
.
types
.
CompletionUsage
(
completion_tokens
=
10
,
prompt_tokens
=
20
2
,
total_tokens
=
21
2
)
completion_tokens
=
10
,
prompt_tokens
=
20
1
,
total_tokens
=
21
1
)
message
=
choice
.
message
message
=
choice
.
message
message
=
chat_completion
.
choices
[
0
].
message
message
=
chat_completion
.
choices
[
0
].
message
...
@@ -140,7 +140,7 @@ async def test_single_chat_session_audio_base64encoded(
...
@@ -140,7 +140,7 @@ async def test_single_chat_session_audio_base64encoded(
choice
=
chat_completion
.
choices
[
0
]
choice
=
chat_completion
.
choices
[
0
]
assert
choice
.
finish_reason
==
"length"
assert
choice
.
finish_reason
==
"length"
assert
chat_completion
.
usage
==
openai
.
types
.
CompletionUsage
(
assert
chat_completion
.
usage
==
openai
.
types
.
CompletionUsage
(
completion_tokens
=
10
,
prompt_tokens
=
20
2
,
total_tokens
=
21
2
)
completion_tokens
=
10
,
prompt_tokens
=
20
1
,
total_tokens
=
21
1
)
message
=
choice
.
message
message
=
choice
.
message
message
=
chat_completion
.
choices
[
0
].
message
message
=
chat_completion
.
choices
[
0
].
message
...
@@ -196,7 +196,7 @@ async def test_single_chat_session_input_audio(
...
@@ -196,7 +196,7 @@ async def test_single_chat_session_input_audio(
choice
=
chat_completion
.
choices
[
0
]
choice
=
chat_completion
.
choices
[
0
]
assert
choice
.
finish_reason
==
"length"
assert
choice
.
finish_reason
==
"length"
assert
chat_completion
.
usage
==
openai
.
types
.
CompletionUsage
(
assert
chat_completion
.
usage
==
openai
.
types
.
CompletionUsage
(
completion_tokens
=
10
,
prompt_tokens
=
20
2
,
total_tokens
=
21
2
)
completion_tokens
=
10
,
prompt_tokens
=
20
1
,
total_tokens
=
21
1
)
message
=
choice
.
message
message
=
choice
.
message
message
=
chat_completion
.
choices
[
0
].
message
message
=
chat_completion
.
choices
[
0
].
message
...
...
tests/entrypoints/openai/test_vision.py
View file @
ce26b162
...
@@ -92,7 +92,7 @@ async def test_single_chat_session_image(client: openai.AsyncOpenAI,
...
@@ -92,7 +92,7 @@ async def test_single_chat_session_image(client: openai.AsyncOpenAI,
choice
=
chat_completion
.
choices
[
0
]
choice
=
chat_completion
.
choices
[
0
]
assert
choice
.
finish_reason
==
"length"
assert
choice
.
finish_reason
==
"length"
assert
chat_completion
.
usage
==
openai
.
types
.
CompletionUsage
(
assert
chat_completion
.
usage
==
openai
.
types
.
CompletionUsage
(
completion_tokens
=
10
,
prompt_tokens
=
77
5
,
total_tokens
=
78
5
)
completion_tokens
=
10
,
prompt_tokens
=
77
4
,
total_tokens
=
78
4
)
message
=
choice
.
message
message
=
choice
.
message
message
=
chat_completion
.
choices
[
0
].
message
message
=
chat_completion
.
choices
[
0
].
message
...
@@ -185,7 +185,7 @@ async def test_single_chat_session_image_base64encoded(
...
@@ -185,7 +185,7 @@ async def test_single_chat_session_image_base64encoded(
choice
=
chat_completion
.
choices
[
0
]
choice
=
chat_completion
.
choices
[
0
]
assert
choice
.
finish_reason
==
"length"
assert
choice
.
finish_reason
==
"length"
assert
chat_completion
.
usage
==
openai
.
types
.
CompletionUsage
(
assert
chat_completion
.
usage
==
openai
.
types
.
CompletionUsage
(
completion_tokens
=
10
,
prompt_tokens
=
77
5
,
total_tokens
=
78
5
)
completion_tokens
=
10
,
prompt_tokens
=
77
4
,
total_tokens
=
78
4
)
message
=
choice
.
message
message
=
choice
.
message
message
=
chat_completion
.
choices
[
0
].
message
message
=
chat_completion
.
choices
[
0
].
message
...
...
tests/entrypoints/openai/test_vision_embedding.py
View file @
ce26b162
...
@@ -93,5 +93,5 @@ async def test_image_embedding(server: RemoteOpenAIServer, model_name: str,
...
@@ -93,5 +93,5 @@ async def test_image_embedding(server: RemoteOpenAIServer, model_name: str,
assert
len
(
embeddings
.
data
)
==
1
assert
len
(
embeddings
.
data
)
==
1
assert
len
(
embeddings
.
data
[
0
].
embedding
)
==
3072
assert
len
(
embeddings
.
data
[
0
].
embedding
)
==
3072
assert
embeddings
.
usage
.
completion_tokens
==
0
assert
embeddings
.
usage
.
completion_tokens
==
0
assert
embeddings
.
usage
.
prompt_tokens
==
76
4
assert
embeddings
.
usage
.
prompt_tokens
==
76
3
assert
embeddings
.
usage
.
total_tokens
==
76
4
assert
embeddings
.
usage
.
total_tokens
==
76
3
vllm/inputs/preprocess.py
View file @
ce26b162
...
@@ -260,9 +260,6 @@ class InputPreprocessor:
...
@@ -260,9 +260,6 @@ class InputPreprocessor:
mm_processor
=
self
.
mm_registry
.
create_processor
(
mm_processor
=
self
.
mm_registry
.
create_processor
(
self
.
model_config
,
tokenizer
)
self
.
model_config
,
tokenizer
)
if
isinstance
(
prompt
,
list
):
prompt
=
tokenizer
.
decode
(
prompt
)
if
mm_processor_kwargs
is
None
:
if
mm_processor_kwargs
is
None
:
mm_processor_kwargs
=
{}
mm_processor_kwargs
=
{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment