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
jerrrrry
infinilm
Commits
4fd9d490
Unverified
Commit
4fd9d490
authored
Nov 06, 2025
by
spike-zhu
Committed by
GitHub
Nov 06, 2025
Browse files
issue/71: support vllm benchmark text completion in InfiniLM
parent
1c710c19
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
scripts/launch_server.py
scripts/launch_server.py
+8
-1
No files found.
scripts/launch_server.py
View file @
4fd9d490
...
@@ -98,6 +98,7 @@ def chunk_json(id_, content=None, role=None, finish_reason=None):
...
@@ -98,6 +98,7 @@ def chunk_json(id_, content=None, role=None, finish_reason=None):
"choices"
:
[
"choices"
:
[
{
{
"index"
:
0
,
"index"
:
0
,
"text"
:
content
,
"delta"
:
delta
,
"delta"
:
delta
,
"logprobs"
:
None
,
"logprobs"
:
None
,
"finish_reason"
:
finish_reason
,
"finish_reason"
:
finish_reason
,
...
@@ -275,9 +276,15 @@ async def chat(id_, request_data, request: Request):
...
@@ -275,9 +276,15 @@ async def chat(id_, request_data, request: Request):
@
App
.
post
(
"/chat/completions"
)
@
App
.
post
(
"/chat/completions"
)
async
def
chat_completions
(
request
:
Request
):
async
def
chat_completions
(
request
:
Request
):
data
=
await
request
.
json
()
data
=
await
request
.
json
()
print
(
'-----------------------------------------'
)
print
(
data
)
print
(
'-----------------------------------------'
)
if
not
data
.
get
(
"messages"
):
if
not
data
.
get
(
"messages"
):
return
JSONResponse
(
content
=
{
"error"
:
"No message provided"
},
status_code
=
400
)
if
not
data
.
get
(
"prompt"
):
return
JSONResponse
(
content
=
{
"error"
:
"No message provided"
},
status_code
=
400
)
else
:
data
[
'messages'
]
=
[{
"role"
:
"user"
,
"content"
:
data
.
get
(
"prompt"
)}]
stream
=
data
.
get
(
"stream"
,
False
)
stream
=
data
.
get
(
"stream"
,
False
)
id_
=
f
"cmpl-
{
uuid
.
uuid4
().
hex
}
"
id_
=
f
"cmpl-
{
uuid
.
uuid4
().
hex
}
"
...
...
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