Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
norm
vllm
Commits
a6d471c7
Unverified
Commit
a6d471c7
authored
Feb 29, 2024
by
Jae-Won Chung
Committed by
GitHub
Feb 28, 2024
Browse files
Fix: `AttributeError` in OpenAI-compatible server (#3018)
parent
01a5d18a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
vllm/entrypoints/openai/protocol.py
vllm/entrypoints/openai/protocol.py
+1
-1
vllm/entrypoints/openai/serving_chat.py
vllm/entrypoints/openai/serving_chat.py
+1
-1
No files found.
vllm/entrypoints/openai/protocol.py
View file @
a6d471c7
...
@@ -57,7 +57,7 @@ class UsageInfo(BaseModel):
...
@@ -57,7 +57,7 @@ class UsageInfo(BaseModel):
class
ChatCompletionRequest
(
BaseModel
):
class
ChatCompletionRequest
(
BaseModel
):
model
:
str
model
:
str
messages
:
Union
[
str
,
List
[
Dict
[
str
,
str
]]
]
messages
:
List
[
Dict
[
str
,
str
]]
temperature
:
Optional
[
float
]
=
0.7
temperature
:
Optional
[
float
]
=
0.7
top_p
:
Optional
[
float
]
=
1.0
top_p
:
Optional
[
float
]
=
1.0
n
:
Optional
[
int
]
=
1
n
:
Optional
[
int
]
=
1
...
...
vllm/entrypoints/openai/serving_chat.py
View file @
a6d471c7
...
@@ -80,7 +80,7 @@ class OpenAIServingChat(OpenAIServing):
...
@@ -80,7 +80,7 @@ class OpenAIServingChat(OpenAIServing):
if
request
.
add_generation_prompt
:
if
request
.
add_generation_prompt
:
return
self
.
response_role
return
self
.
response_role
else
:
else
:
return
request
.
messages
[
-
1
]
.
role
return
request
.
messages
[
-
1
]
[
"
role
"
]
async
def
chat_completion_stream_generator
(
async
def
chat_completion_stream_generator
(
self
,
request
:
ChatCompletionRequest
,
self
,
request
:
ChatCompletionRequest
,
...
...
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