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
change
sglang
Commits
19ba2b0e
Unverified
Commit
19ba2b0e
authored
Dec 22, 2024
by
Lei
Committed by
GitHub
Dec 22, 2024
Browse files
Add lora_paths to v1_chat_generate_request (#2529)
parent
4e1e3cff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
python/sglang/srt/openai_api/adapter.py
python/sglang/srt/openai_api/adapter.py
+4
-0
No files found.
python/sglang/srt/openai_api/adapter.py
View file @
19ba2b0e
...
@@ -858,6 +858,7 @@ def v1_chat_generate_request(
...
@@ -858,6 +858,7 @@ def v1_chat_generate_request(
logprob_start_lens
=
[]
logprob_start_lens
=
[]
top_logprobs_nums
=
[]
top_logprobs_nums
=
[]
modalities_list
=
[]
modalities_list
=
[]
lora_paths
=
[]
# NOTE: with openai API, the prompt's logprobs are always not computed
# NOTE: with openai API, the prompt's logprobs are always not computed
...
@@ -920,6 +921,7 @@ def v1_chat_generate_request(
...
@@ -920,6 +921,7 @@ def v1_chat_generate_request(
return_logprobs
.
append
(
request
.
logprobs
)
return_logprobs
.
append
(
request
.
logprobs
)
logprob_start_lens
.
append
(
-
1
)
logprob_start_lens
.
append
(
-
1
)
top_logprobs_nums
.
append
(
request
.
top_logprobs
or
0
)
top_logprobs_nums
.
append
(
request
.
top_logprobs
or
0
)
lora_paths
.
append
(
request
.
lora_path
)
sampling_params
=
{
sampling_params
=
{
"temperature"
:
request
.
temperature
,
"temperature"
:
request
.
temperature
,
...
@@ -958,6 +960,7 @@ def v1_chat_generate_request(
...
@@ -958,6 +960,7 @@ def v1_chat_generate_request(
logprob_start_lens
=
logprob_start_lens
[
0
]
logprob_start_lens
=
logprob_start_lens
[
0
]
top_logprobs_nums
=
top_logprobs_nums
[
0
]
top_logprobs_nums
=
top_logprobs_nums
[
0
]
modalities_list
=
modalities_list
[
0
]
modalities_list
=
modalities_list
[
0
]
lora_paths
=
lora_paths
[
0
]
else
:
else
:
if
isinstance
(
input_ids
[
0
],
str
):
if
isinstance
(
input_ids
[
0
],
str
):
prompt_kwargs
=
{
"text"
:
input_ids
}
prompt_kwargs
=
{
"text"
:
input_ids
}
...
@@ -975,6 +978,7 @@ def v1_chat_generate_request(
...
@@ -975,6 +978,7 @@ def v1_chat_generate_request(
return_text_in_logprobs
=
True
,
return_text_in_logprobs
=
True
,
rid
=
request_ids
,
rid
=
request_ids
,
modalities
=
modalities_list
,
modalities
=
modalities_list
,
lora_path
=
lora_paths
,
)
)
return
adapted_request
,
all_requests
if
len
(
all_requests
)
>
1
else
all_requests
[
0
]
return
adapted_request
,
all_requests
if
len
(
all_requests
)
>
1
else
all_requests
[
0
]
...
...
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